From ce57212c90bf48cab4c1c07114a7a8f3442d81e7 Mon Sep 17 00:00:00 2001 From: Jon Cave Date: Thu, 18 Aug 2011 18:17:37 +0000 Subject: [PATCH] add_option() should always return a boolean, see #18422 git-svn-id: https://develop.svn.wordpress.org/trunk@18567 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 49bd56b30f..3b950df17d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -586,7 +586,7 @@ function update_option( $option, $newvalue ) { * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. * @param mixed $deprecated Optional. Description. Not used anymore. * @param bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up. - * @return null returns when finished. + * @return bool False if option was not added and true if option was added. */ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) { global $wpdb; @@ -609,7 +609,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) $notoptions = wp_cache_get( 'notoptions', 'options' ); if ( !is_array( $notoptions ) || !isset( $notoptions[$option] ) ) if ( false !== get_option( $option ) ) - return; + return false; $_value = $value; $value = maybe_serialize( $value );