Options: After [33738], consistently pass option name as the second parameter to the 'default_option_' . $option filter in add_option() and update_option().

Props dlh.
Fixes #36761.

git-svn-id: https://develop.svn.wordpress.org/trunk@37367 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2016-05-05 20:23:43 +00:00
parent 265afb64a9
commit 427c92cafe

View File

@ -295,7 +295,7 @@ function update_option( $option, $value, $autoload = null ) {
return false;
/** This filter is documented in wp-includes/option.php */
if ( apply_filters( 'default_option_' . $option, false ) === $old_value ) {
if ( apply_filters( 'default_option_' . $option, false, $option ) === $old_value ) {
// Default setting for new options is 'yes'.
if ( null === $autoload ) {
$autoload = 'yes';
@ -416,7 +416,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
$notoptions = wp_cache_get( 'notoptions', 'options' );
if ( !is_array( $notoptions ) || !isset( $notoptions[$option] ) )
/** This filter is documented in wp-includes/option.php */
if ( apply_filters( 'default_option_' . $option, false ) !== get_option( $option ) )
if ( apply_filters( 'default_option_' . $option, false, $option ) !== get_option( $option ) )
return false;
$serialized_value = maybe_serialize( $value );