Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20851] trunk/wp-includes/class-wp-customize.php: Translate and empty header text color into the default text color. Date:Wed, 23 May 2012 15:36:27 +0000 (UTC)
 

Revision
20851
Author
ryan
Date
2012-05-23 15:36:27 +0000 (Wed, 23 May 2012)

Log Message

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

Modified Paths

Diff

Modified: trunk/wp-includes/class-wp-customize.php (20850 => 20851)


--- trunk/wp-includes/class-wp-customize.php	2012-05-23 15:05:29 UTC (rev 20850)
+++ trunk/wp-includes/class-wp-customize.php	2012-05-23 15:36:27 UTC (rev 20851)
@@ -564,8 +564,7 @@
 		) );
 
 		$this->add_setting( 'header_textcolor', array(
-			// @todo: replace with a new accept() setting method
-			// 'sanitize_callback' => 'sanitize_hexcolor',
+			'sanitize_callback' => 'sanitize_header_textcolor',
 			'theme_supports' => array( 'custom-header', 'header-text' ),
 			'default'        => get_theme_support( 'custom-header', 'default-text-color' ),
 		) );
@@ -793,6 +792,17 @@
 	}
 };
 
+// Callback function for sanitizing the header textcolor setting.
+function sanitize_header_textcolor( $color ) {
+	if ( empty( $color ) )
+		return get_theme_support( 'custom-header', 'default-text-color' );
+
+	elseif ( $color == 'blank' )
+		return 'blank';
+
+	return sanitize_hexcolor( $color );
+}
+
 // Callback function for sanitizing a hex color
 function sanitize_hexcolor( $color ) {
 	$color = preg_replace( '/[^0-9a-fA-F]/', '', $color );