From 22863bd9c3d8b16a1f8ef9dd36b1fdd44a166dd1 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 21 Mar 2012 19:10:13 +0000 Subject: [PATCH] Use display_header_text() in custom-header.php. Rework the UI to be a 'Show header text' checkbox (rather than radio buttons). Remove lame 'blank' hack for no-JS -- checkboxes work without JS. Move 'Select a Color' to a link like it is for custom background. Nearby code cleanup. see #18887. git-svn-id: http://svn.automattic.com/wordpress/trunk@20241 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 146 +++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 78 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 291986e75..5a81102e2 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -208,16 +208,17 @@ class Custom_Image_Header { return; } - if ( isset( $_POST['text-color'] ) ) { + if ( ! isset( $_POST['display-header-text'] ) ) { + check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); + set_theme_mod( 'header_textcolor', 'blank' ); + } elseif ( isset( $_POST['text-color'] ) ) { check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); $_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] ); - if ( 'blank' == $_POST['text-color'] ) { + $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['text-color']); + if ( strlen($color) == 6 || strlen($color) == 3 ) + set_theme_mod('header_textcolor', $color); + elseif ( ! $color ) set_theme_mod( 'header_textcolor', 'blank' ); - } else { - $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['text-color']); - if ( strlen($color) == 6 || strlen($color) == 3 ) - set_theme_mod('header_textcolor', $color); - } } if ( isset( $_POST['default-header'] ) ) { @@ -329,86 +330,75 @@ class Custom_Image_Header { function js_1() { ?> +

+ @@ -519,14 +511,13 @@ class Custom_Image_Header { ?>
-

onclick="return false;" href="">

-
>
+

onclick="return false;" href="">

+
>
@@ -618,33 +609,32 @@ class Custom_Image_Header {
- + + + +

+ - - + + - + @@ -662,7 +652,7 @@ class Custom_Image_Header {

- - - +

+ - #blank as text color.' );?> - + + + +

-