Allow $autoload in add_option() to receive false.

props dllh.
fixes #31119.

Built from https://develop.svn.wordpress.org/trunk@31278


git-svn-id: http://core.svn.wordpress.org/trunk@31259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2015-01-25 07:51:23 +00:00
parent 4b8277237f
commit 1b8f71041b
2 changed files with 4 additions and 3 deletions

View File

@ -346,7 +346,8 @@ function update_option( $option, $value ) {
* @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.
* @param string|bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up.
* @param string|bool $autoload Optional. Whether to load the option when WordPress starts up.
* Default is enabled. Accepts 'no' to disable for legacy reasons.
* @return bool False if option was not added and true if option was added.
*/
function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) {
@ -373,7 +374,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
return false;
$serialized_value = maybe_serialize( $value );
$autoload = ( 'no' === $autoload ) ? 'no' : 'yes';
$autoload = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes';
/**
* Fires before an option is added.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31277';
$wp_version = '4.2-alpha-31278';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.