Ticket #22498: 22498.diff
File 22498.diff, 1.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/custom-header.php
272 272 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); 273 273 $_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] ); 274 274 $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 ) { 278 279 set_theme_mod( 'header_textcolor', 'blank' ); 280 } 279 281 } 280 282 281 283 if ( isset( $_POST['default-header'] ) ) { … … 689 691 690 692 $default_color_attr = $default_color ? ' data-default-color="' . esc_attr( $default_color ) . '"' : ''; 691 693 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 693 702 if ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) { 694 703 $header_textcolor = '#' . $header_textcolor; 695 704 }