diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index a16b100795..7f1f98ac3b 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -696,6 +696,15 @@ class WP_Customize_Setting { $is_core_type = ( 'option' === $this->type || 'theme_mod' === $this->type ); if ( ! $is_core_type && ! $this->is_multidimensional_aggregated ) { + + // Use post value if previewed and a post value is present. + if ( $this->is_previewed ) { + $value = $this->post_value( null ); + if ( null !== $value ) { + return $value; + } + } + $value = $this->get_root_value( $this->default ); /** diff --git a/wp-includes/customize/class-wp-customize-custom-css-setting.php b/wp-includes/customize/class-wp-customize-custom-css-setting.php index eb9379e425..eadd47c581 100644 --- a/wp-includes/customize/class-wp-customize-custom-css-setting.php +++ b/wp-includes/customize/class-wp-customize-custom-css-setting.php @@ -132,10 +132,13 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting { * @return string */ public function value() { - $id_base = $this->id_data['base']; - if ( $this->is_previewed && null !== $this->post_value( null ) ) { - return $this->post_value(); + if ( $this->is_previewed ) { + $post_value = $this->post_value( null ); + if ( null !== $post_value ) { + return $post_value; + } } + $id_base = $this->id_data['base']; $value = ''; $post = wp_get_custom_css_post( $this->stylesheet ); if ( $post ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 0950d9f6ee..9ce114eecf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39317'; +$wp_version = '4.7-beta4-39318'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.