Advertisements

wp_load_alloptions

Definition:
function wp_load_alloptions() {}

Loads and caches all autoloaded options, if available or all options.

Return values

returns:List of all options.

Source code

function wp_load_alloptions() {

	global $wpdb;



	if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )

		$alloptions = wp_cache_get( 'alloptions', 'options' );

	else

		$alloptions = false;



	if ( !$alloptions ) {

		$suppress = $wpdb->suppress_errors();

		if ( !$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )

			$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );

		$wpdb->suppress_errors($suppress);

		$alloptions = array();

		foreach ( (array) $alloptions_db as $o ) {

			$alloptions[$o->option_name] = $o->option_value;

		}

		if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )

			wp_cache_add( 'alloptions', $alloptions, 'options' );

	}



	return $alloptions;

}

3871

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: