WordPress.org

Make WordPress Core

Changeset 20851


Ignore:
Timestamp:
05/23/2012 03:36:27 PM (8 years ago)
Author:
ryan
Message:

Translate and empty header text color into the default text color. Honor blank. Props kovshenin. fixes #20600

File:
1 edited

Legend:

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

    r20809 r20851  
    565565
    566566        $this->add_setting( 'header_textcolor', array(
    567             // @todo: replace with a new accept() setting method
    568             // 'sanitize_callback' => 'sanitize_hexcolor',
     567            'sanitize_callback' => 'sanitize_header_textcolor',
    569568            'theme_supports' => array( 'custom-header', 'header-text' ),
    570569            'default'        => get_theme_support( 'custom-header', 'default-text-color' ),
     
    794793};
    795794
     795// Callback function for sanitizing the header textcolor setting.
     796function sanitize_header_textcolor( $color ) {
     797    if ( empty( $color ) )
     798        return get_theme_support( 'custom-header', 'default-text-color' );
     799
     800    elseif ( $color == 'blank' )
     801        return 'blank';
     802
     803    return sanitize_hexcolor( $color );
     804}
     805
    796806// Callback function for sanitizing a hex color
    797807function sanitize_hexcolor( $color ) {
Note: See TracChangeset for help on using the changeset viewer.