X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/5964d2279dc52bdfe105f9bfa17e04337d47a3fa..c55863f11e8589bf8d4a5698bf15752406654f1c:/wp-includes/class-wp-customize-manager.php diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 4be33896..cad9f135 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -310,7 +310,7 @@ final class WP_Customize_Manager { public function post_value( $setting ) { if ( ! isset( $this->_post_values ) ) { if ( isset( $_POST['customized'] ) ) - $this->_post_values = json_decode( stripslashes( $_POST['customized'] ), true ); + $this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true ); else $this->_post_values = false; } @@ -512,6 +512,8 @@ final class WP_Customize_Manager { $setting->save(); } + do_action( 'customize_save_after', $this ); + die; } @@ -897,9 +899,7 @@ final class WP_Customize_Manager { if ( $menus ) { $choices = array( 0 => __( '— Select —' ) ); foreach ( $menus as $menu ) { - $truncated_name = wp_html_excerpt( $menu->name, 40 ); - $truncated_name = ( $truncated_name == $menu->name ) ? $menu->name : trim( $truncated_name ) . '…'; - $choices[ $menu->term_id ] = $truncated_name; + $choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '…' ); } foreach ( $locations as $location => $description ) { @@ -975,6 +975,7 @@ final class WP_Customize_Manager { * Callback for validating the header_textcolor value. * * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash(). + * Returns default text color if hex color is empty. * * @since 3.4.0 * @@ -982,7 +983,14 @@ final class WP_Customize_Manager { * @return string */ public function _sanitize_header_textcolor( $color ) { - return ( 'blank' === $color ) ? 'blank' : sanitize_hex_color_no_hash( $color ); + if ( 'blank' === $color ) + return 'blank'; + + $color = sanitize_hex_color_no_hash( $color ); + if ( empty( $color ) ) + $color = get_theme_support( 'custom-header', 'default-text-color' ); + + return $color; } };