Make WordPress Core

Ticket #22498: 22498.diff

File 22498.diff, 1.6 KB (added by kovshenin, 11 years ago)
  • src/wp-admin/custom-header.php

     
    272272                        check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
    273273                        $_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] );
    274274                        $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['text-color']);
    275                         if ( strlen($color) == 6 || strlen($color) == 3 )
    276                                 set_theme_mod('header_textcolor', $color);
    277                         elseif ( ! $color )
     275                        if ( strlen( $color ) == 6 || strlen( $color ) == 3 ) {
     276                                set_theme_mod( 'header_textcolor', $color );
     277                                set_theme_mod( 'header_textcolor_orig', $color );
     278                        } elseif ( ! $color ) {
    278279                                set_theme_mod( 'header_textcolor', 'blank' );
     280                        }
    279281                }
    280282
    281283                if ( isset( $_POST['default-header'] ) ) {
     
    689691
    690692        $default_color_attr = $default_color ? ' data-default-color="' . esc_attr( $default_color ) . '"' : '';
    691693
    692         $header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
     694        if ( display_header_text() ) {
     695                $header_textcolor = get_header_textcolor();
     696        } elseif ( get_theme_mod( 'header_textcolor_orig', false ) ) {
     697                $header_textcolor = get_theme_mod( 'header_textcolor_orig' );
     698        } else {
     699                $header_textcolor = get_theme_support( 'custom-header', 'default-text-color' );
     700        }
     701
    693702        if ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) {
    694703                $header_textcolor = '#' . $header_textcolor;
    695704        }