Uses
Uses | Description |
---|---|
wp-includes/capabilities.php: current_user_can() | Returns whether the current user has the specified capability. |
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
Retrieve blog options value from list.
(array) (Required) Options to retrieve.
(array)
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; }
Version | Description |
---|---|
2.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/_getoptions