[wp-trac] [WordPress Trac] #18887: Appearnce -> Header UI: "Display Text" Needs Distinct theme_mod

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 8 13:40:53 UTC 2011


#18887: Appearnce -> Header UI: "Display Text" Needs Distinct theme_mod
--------------------------+-----------------------------
 Reporter:  chipbennett   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  UI            |    Version:  3.2
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 The current UI on the Appearance -> Header admin screen is misleading with
 respect to the "Display Text" form field. This field does not have a
 distinct theme_mod, but rather correlates to `HEADER_TEXTCOLOR`. From
 [http://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/custom-
 header.php#L577 `wp-admin\custom-header.php`]:
 {{{
 <td>
         <p>
         <?php $hidetext = get_theme_mod( 'header_textcolor',
 HEADER_TEXTCOLOR ); ?>
         <label><input type="radio" value="1" name="hidetext"
 id="hidetext"<?php checked( ( 'blank' == $hidetext || empty( $hidetext ) )
 ? true : false ); ?> /> <?php _e( 'No' ); ?></label>
         <label><input type="radio" value="0" name="hidetext"
 id="showtext"<?php checked( ( 'blank' == $hidetext || empty( $hidetext ) )
 ? false : true ); ?> /> <?php _e( 'Yes' ); ?></label>
         </p>
 </td>
 }}}
 The issue is with this line:
 {{{
 <?php $hidetext = get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR );
 ?>
 }}}

 Conditionally displaying text based on the theme_mod for
 `header_textcolor` being defined or not is unintuitive. There is no
 practical reason that the theme_mod to display/not display header text
 should be tied to the theme_mod specifying the header text color. Yet,
 currently, in order to support the "Display Text" field, header text
 output must be wrapped in a `if ( 'blank' != get_header_textcolor() )`
 conditional.

 I think the simplest solution would be to create a distinct `theme_mod`
 for `display_text`, with a corresponding `display_header_text()`
 conditional.

 (See also ticket #17605)

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


More information about the wp-trac mailing list