Make WordPress Core


Ignore:
Timestamp:
11/20/2012 01:53:59 AM (12 years ago)
Author:
nacin
Message:

Custom Header: Remove Farbtastic-era "Reset Text Color" button. Show default color when JS is disabled. props DrewAPicture. fixes #22461.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r22521 r22695  
    213213            check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
    214214            $this->reset_header_image();
    215             return;
    216         }
    217 
    218         if ( isset( $_POST['resettext'] ) ) {
    219             check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
    220             remove_theme_mod('header_textcolor');
    221215            return;
    222216        }
     
    629623$header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
    630624$default_color = '';
    631 if ( current_theme_supports( 'custom-header', 'default-text-color' ) )
    632     $default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-header', 'default-text-color' ) ) . '"';
     625if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {
     626    $default_color = '#' . get_theme_support( 'custom-header', 'default-text-color' );
     627    $default_color_attr = ' data-default-color="' . esc_attr( $default_color ) . '"';
     628    echo '<input type="text" name="text-color" id="text-color" value="#' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />';
     629    if ( $default_color )
     630        echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), $default_color ) . '</span>';
     631}
    633632?>
    634         <input type="text" name="text-color" id="text-color" value="#<?php echo esc_attr( $header_textcolor ); ?>"<?php echo $default_color; ?> />
    635633    </p>
    636634</td>
    637635</tr>
    638 
    639     <?php if ( current_theme_supports( 'custom-header', 'default-text-color' ) && get_theme_mod( 'header_textcolor' ) ) { ?>
    640 <tr valign="top">
    641 <th scope="row"><?php _e('Reset Text Color'); ?></th>
    642 <td>
    643     <p><?php _e( 'This will restore the original header text. You will not be able to restore any customizations.' ) ?></p>
    644     <?php submit_button( __( 'Restore Original Header Text' ), 'button', 'resettext', false ); ?>
    645 </td>
    646 </tr>
    647     <?php } ?>
    648 
    649636</tbody>
    650637</table>
Note: See TracChangeset for help on using the changeset viewer.