Changeset 28294
- Timestamp:
- 05/06/2014 03:26:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/custom-header.php
r28290 r28294 326 326 * @since 2.6.0 327 327 */ 328 function js_1() { ?> 328 function js_1() { 329 $default_color = ''; 330 if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) { 331 $default_color = get_theme_support( 'custom-header', 'default-text-color' ); 332 if ( $default_color && false === strpos( $default_color, '#' ) ) { 333 $default_color = '#' . $default_color; 334 } 335 } 336 ?> 337 329 338 <script type="text/javascript"> 330 339 /* <![CDATA[ */ 331 340 (function($){ 332 var default_color = ' #<?php echo get_theme_support( 'custom-header', 'default-text-color' ); ?>',341 var default_color = '<?php echo $default_color; ?>', 333 342 header_text_fields; 334 343 … … 625 634 <td> 626 635 <p> 627 <?php 628 $header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' ); 629 630 if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) { 631 $default_color = '#' . get_theme_support( 'custom-header', 'default-text-color' ); 632 $default_color_attr = ' data-default-color="' . esc_attr( $default_color ) . '"'; 633 echo '<input type="text" name="text-color" id="text-color" value="#' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />'; 634 if ( $default_color ) 635 echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), $default_color ) . '</span>'; 636 } 637 ?> 636 <?php 637 $default_color = ''; 638 if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) { 639 $default_color = get_theme_support( 'custom-header', 'default-text-color' ); 640 if ( $default_color && false === strpos( $default_color, '#' ) ) { 641 $default_color = '#' . $default_color; 642 } 643 } 644 645 $default_color_attr = $default_color ? ' data-default-color="' . esc_attr( $default_color ) . '"' : ''; 646 647 $header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' ); 648 if ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) { 649 $header_textcolor = '#' . $header_textcolor; 650 } 651 652 echo '<input type="text" name="text-color" id="text-color" value="' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />'; 653 if ( $default_color ) { 654 echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . '</span>'; 655 } 656 ?> 638 657 </p> 639 658 </td>
Note: See TracChangeset
for help on using the changeset viewer.