WordPress.org

Make WordPress Core

Changeset 24687


Ignore:
Timestamp:
07/12/13 20:41:46 (9 months ago)
Author:
nacin
Message:

Avoid empty header color after enabling header text via Customizer. props obenland, fixes #23761.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize-manager.php

    r24344 r24687  
    976976     * 
    977977     * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash(). 
     978     * Returns default text color if hex color is empty. 
    978979     * 
    979980     * @since 3.4.0 
     
    983984     */ 
    984985    public function _sanitize_header_textcolor( $color ) { 
    985         return ( 'blank' === $color ) ? 'blank' : sanitize_hex_color_no_hash( $color ); 
     986        if ( 'blank' === $color ) 
     987            return 'blank'; 
     988 
     989        $color = sanitize_hex_color_no_hash( $color ); 
     990        if ( empty( $color ) ) 
     991            $color = get_theme_support( 'custom-header', 'default-text-color' ); 
     992 
     993        return $color; 
    986994    } 
    987995}; 
Note: See TracChangeset for help on using the changeset viewer.