From 9a5af9d3d204e05fee80864cc7d9eda1489331b1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 26 May 2015 22:16:15 +0000 Subject: [PATCH] Fix doc blocks for `option.php`. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32613 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/option.php | 50 +++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 5149f4c598..5ba890ec6c 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -18,8 +18,10 @@ * * @since 1.5.0 * - * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. - * @param mixed $default Optional. Default value to return if the option does not exist. + * @global wpdb $wpdb + * + * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. + * @param mixed $default Optional. Default value to return if the option does not exist. * @return mixed Value set for the option. */ function get_option( $option, $default = false ) { @@ -153,6 +155,8 @@ function form_option( $option ) { * * @since 2.2.0 * + * @global wpdb $wpdb + * * @return array List of all options. */ function wp_load_alloptions() { @@ -184,6 +188,8 @@ function wp_load_alloptions() { * * @since 3.0.0 * + * @global wpdb $wpdb + * * @param int $site_id Optional site ID for which to query the options. Defaults to the current site. */ function wp_load_core_site_options( $site_id = null ) { @@ -222,6 +228,8 @@ function wp_load_core_site_options( $site_id = null ) { * @since 1.0.0 * @since 4.2.0 The `$autoload` parameter was added. * + * @global wpdb $wpdb + * * @param string $option Option name. Expected to not be SQL-escaped. * @param mixed $value Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. * @param string|bool $autoload Optional. Whether to load the option when WordPress starts up. For existing options, @@ -362,6 +370,8 @@ function update_option( $option, $value, $autoload = null ) { * * @since 1.0.0 * + * @global wpdb $wpdb + * * @param string $option Name of option to add. Expected to not be SQL-escaped. * @param mixed $value Optional. Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. * @param string $deprecated Optional. Description. Not used anymore. @@ -457,6 +467,8 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) * * @since 1.2.0 * + * @global wpdb $wpdb + * * @param string $option Name of option to remove. Expected to not be SQL-escaped. * @return bool True, if option is successfully deleted. False on failure. */ @@ -778,7 +790,7 @@ function wp_user_settings() { * * @since 2.7.0 * - * @param string $name The name of the setting. + * @param string $name The name of the setting. * @param string $default Optional default value to return when $name is not set. * @return mixed the last saved user setting or the default value/false if it doesn't exist. */ @@ -796,12 +808,11 @@ function get_user_setting( $name, $default = false ) { * * @since 2.8.0 * - * @param string $name The name of the setting. + * @param string $name The name of the setting. * @param string $value The value for the setting. - * @return null|bool true if set successfully/false if not. + * @return bool|void true if set successfully/false if not. */ function set_user_setting( $name, $value ) { - if ( headers_sent() ) { return false; } @@ -821,10 +832,9 @@ function set_user_setting( $name, $value ) { * @since 2.7.0 * * @param string $names The name or array of names of the setting to be deleted. - * @return null|bool true if deleted successfully/false if not. + * @return bool|void true if deleted successfully/false if not. */ function delete_user_setting( $names ) { - if ( headers_sent() ) { return false; } @@ -852,6 +862,8 @@ function delete_user_setting( $names ) { * * @since 2.7.0 * + * @global array $_updated_user_settings + * * @return array the last saved user settings or empty array. */ function get_all_user_settings() { @@ -890,8 +902,10 @@ function get_all_user_settings() { * * @since 2.8.0 * + * @global array $_updated_user_settings + * * @param array $user_settings - * @return null|bool + * @return bool|void */ function wp_set_all_user_settings( $user_settings ) { global $_updated_user_settings; @@ -944,9 +958,11 @@ function delete_all_user_settings() { * * @see get_option() * - * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. - * @param mixed $default Optional value to return if option doesn't exist. Default false. - * @param bool $use_cache Whether to use cache. Multisite only. Default true. + * @global wpdb $wpdb + * + * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. + * @param mixed $default Optional value to return if option doesn't exist. Default false. + * @param bool $use_cache Whether to use cache. Multisite only. Default true. * @return mixed Value set for the option. */ function get_site_option( $option, $default = false, $use_cache = true ) { @@ -1039,8 +1055,10 @@ function get_site_option( $option, $default = false, $use_cache = true ) { * * @see add_option() * + * @global wpdb $wpdb + * * @param string $option Name of option to add. Expected to not be SQL-escaped. - * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. + * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. * @return bool False if option was not added and true if option was added. */ function add_site_option( $option, $value ) { @@ -1128,6 +1146,8 @@ function add_site_option( $option, $value ) { * * @see delete_option() * + * @global wpdb $wpdb + * * @param string $option Name of option to remove. Expected to not be SQL-escaped. * @return bool True, if succeed. False, if failure. */ @@ -1192,8 +1212,10 @@ function delete_site_option( $option ) { * * @see update_option() * + * @global wpdb $wpdb + * * @param string $option Name of option. Expected to not be SQL-escaped. - * @param mixed $value Option value. Expected to not be SQL-escaped. + * @param mixed $value Option value. Expected to not be SQL-escaped. * @return bool False if value was not updated and true if value was updated. */ function update_site_option( $option, $value ) {