Ticket #20600: 20600.diff
| File 20600.diff, 1.0 KB (added by , 14 years ago) |
|---|
-
class-wp-customize.php
560 560 ) ); 561 561 562 562 $this->add_setting( 'header_textcolor', array( 563 // @todo: replace with a new accept() setting method 564 // 'sanitize_callback' => 'sanitize_hexcolor', 563 'sanitize_callback' => 'sanitize_header_textcolor', 565 564 'theme_supports' => array( 'custom-header', 'header-text' ), 566 565 'default' => get_theme_support( 'custom-header', 'default-text-color' ), 567 566 ) ); … … 789 788 } 790 789 }; 791 790 791 // Callback function for sanitizing the header textcolor setting. 792 function sanitize_header_textcolor( $color ) { 793 if ( empty( $color ) ) 794 return get_theme_support( 'custom-header', 'default-text-color' ); 795 796 elseif ( $color == 'blank' ) 797 return 'blank'; 798 799 return sanitize_hexcolor( $color ); 800 } 801 792 802 // Callback function for sanitizing a hex color 793 803 function sanitize_hexcolor( $color ) { 794 804 $color = preg_replace( '/[^0-9a-fA-F]/', '', $color );