get_alloptions_110() WordPress Function

The get_alloptions_110() function is used to get all the options for a particular wordpress site. The function takes two parameters: the site id and the option name. The function returns an associative array of all the options for the specified site.

get_alloptions_110() #

Retrieve all options as it was for 1.2.


Return

(stdClass) List of options.


Top ↑

Source

File: wp-admin/includes/upgrade.php

function get_alloptions_110() {
	global $wpdb;
	$all_options = new stdClass;
	$options     = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
	if ( $options ) {
		foreach ( $options as $option ) {
			if ( 'siteurl' === $option->option_name || 'home' === $option->option_name || 'category_base' === $option->option_name ) {
				$option->option_value = untrailingslashit( $option->option_value );
			}
			$all_options->{$option->option_name} = stripslashes( $option->option_value );
		}
	}
	return $all_options;
}


Top ↑

Changelog

Changelog
VersionDescription
1.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.