diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index dd55d374c..1e304d9ab 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -68,8 +68,10 @@ class WP_Customize_Setting { case 'option' : if ( empty( $this->id_data[ 'keys' ] ) ) add_filter( 'pre_option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) ); - else + else { add_filter( 'option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) ); + add_filter( 'default_option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) ); + } break; default : do_action( 'customize_preview_' . $this->id ); diff --git a/wp-includes/option.php b/wp-includes/option.php index 2a25a27a0..6c9a9d067 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -44,6 +44,8 @@ function get_option( $option, $default = false ) { if ( defined( 'WP_SETUP_CONFIG' ) ) return false; + $default = apply_filters( 'default_option_' . $option, $default ); + if ( ! defined( 'WP_INSTALLING' ) ) { // prevent non-existent options from triggering multiple queries $notoptions = wp_cache_get( 'notoptions', 'options' ); @@ -754,6 +756,8 @@ function get_site_option( $option, $default = false, $use_cache = true ) { if ( false !== $pre ) return $pre; + $default = apply_filters( 'default_site_option_' . $option, $default ); + if ( !is_multisite() ) { $value = get_option($option, $default); } else {