Make WordPress Core


Ignore:
Timestamp:
01/25/2015 07:50:31 AM (9 years ago)
Author:
nacin
Message:

Allow $autoload in add_option() to receive false.

props dllh.
fixes #31119.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r30886 r31278  
    347347 * @param mixed          $value       Optional. Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
    348348 * @param string         $deprecated  Optional. Description. Not used anymore.
    349  * @param string|bool    $autoload    Optional. Default is enabled. Whether to load the option when WordPress starts up.
     349 * @param string|bool    $autoload    Optional. Whether to load the option when WordPress starts up.
     350 *                                    Default is enabled. Accepts 'no' to disable for legacy reasons.
    350351 * @return bool False if option was not added and true if option was added.
    351352 */
     
    374375
    375376    $serialized_value = maybe_serialize( $value );
    376     $autoload = ( 'no' === $autoload ) ? 'no' : 'yes';
     377    $autoload = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes';
    377378
    378379    /**
Note: See TracChangeset for help on using the changeset viewer.