From 2bd27eae7cb5309b1404d2884a5ff7725e941a24 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 12 Jul 2013 20:41:46 +0000 Subject: [PATCH] Avoid empty header color after enabling header text via Customizer. props obenland, fixes #23761. git-svn-id: http://core.svn.wordpress.org/trunk@24687 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index f921f2c7da..cad9f1351c 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -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; } };