[wp-trac] [WordPress Trac] #20600: Customize and display_header_text()

WordPress Trac wp-trac at lists.automattic.com
Wed May 2 09:20:28 UTC 2012


#20600: Customize and display_header_text()
--------------------------+-----------------------------
 Reporter:  kovshenin     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.4
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 The header color and display checkbox in the customizer do not work with
 the new display_header_text() function (see #18887) because
 display_header_text() thinks an empty string is a hidden header, while
 Customize assumes than an empty string is the default color, while "blank"
 is a hidden header.

 How to reproduce (using a theme that supports header images, but not the
 new twenty ten/eleven because they now use postMessage):

 * Go to Appearance > Header
 * Remove any header image and hit Restore Original Header Text if
 available
 * Uncheck Show header text with your image
 * Go to Customize and check Display header text

 You'll see that the color value says "Default", the actual color string
 passed will be an empty string, so display_header_text() will think it's
 hidden. I wrote this dirty snippet that outputs some debug info that might
 help:

 {{{
 add_action( 'wp_head', function() {
         $header_text = display_header_text();
         $header_textcolor = get_header_textcolor();

         echo 'header_text: '; var_dump( $header_text ); echo '<br />';
         echo 'header_text_color != blank: '; var_dump( $header_textcolor
 != 'blank' ); echo '<br />';
         echo 'header_text_color: '; var_dump( $header_textcolor ); echo
 '<br />';
 });
 }}}

 Try the reproduce steps again to see how the two methods
 (display_header_text and comparison to blank) differ at some point.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20600>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list