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
This commit is contained in:
Andrew Nacin 2013-07-12 20:41:46 +00:00
parent 4f1f7ee3f2
commit 2bd27eae7c
1 changed files with 9 additions and 1 deletions

View File

@ -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;
}
};