From f7539feb4d50e79b2275db2c277951d02f736d6e Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 6 May 2014 15:27:54 +0000 Subject: [PATCH] Custom Header: Fix logic when a theme doesn't set `default-text-color`. fixes #28042. Built from https://develop.svn.wordpress.org/trunk@28294 git-svn-id: http://core.svn.wordpress.org/trunk@28122 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 43 +++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 4cbf9ec9d4..769e0f9a6e 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -325,11 +325,20 @@ class Custom_Image_Header { * * @since 2.6.0 */ - function js_1() { ?> + function js_1() { + $default_color = ''; + if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) { + $default_color = get_theme_support( 'custom-header', 'default-text-color' ); + if ( $default_color && false === strpos( $default_color, '#' ) ) { + $default_color = '#' . $default_color; + } + } + ?> +