wp_xmlrpc_server::_getOptions() WordPress Method

The wp_xmlrpc_server::_getOptions() function is used to get the list of options for a given blog. This is used by the XML-RPC interface when a user requests the GetOptions method.

wp_xmlrpc_server::_getOptions( array $options ) #

Retrieve blog options value from list.


Parameters

$options

(array)(Required)Options to retrieve.


Top ↑

Return

(array)


Top ↑

Source

File: wp-includes/class-wp-xmlrpc-server.php

	public function _getOptions( $options ) {
		$data       = array();
		$can_manage = current_user_can( 'manage_options' );
		foreach ( $options as $option ) {
			if ( array_key_exists( $option, $this->blog_options ) ) {
				$data[ $option ] = $this->blog_options[ $option ];
				// Is the value static or dynamic?
				if ( isset( $data[ $option ]['option'] ) ) {
					$data[ $option ]['value'] = get_option( $data[ $option ]['option'] );
					unset( $data[ $option ]['option'] );
				}

				if ( ! $can_manage ) {
					$data[ $option ]['readonly'] = true;
				}
			}
		}

		return $data;
	}


Top ↑

Changelog

Changelog
VersionDescription
2.6.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.

Show More
Show More