Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [21053] trunk/wp-includes: Theme Customizer: Remove background_image_thumb when saving settings. Date:Mon, 11 Jun 2012 20:49:45 +0000 (UTC)
 

Revision
21053
Author
nacin
Date
2012-06-11 20:49:45 +0000 (Mon, 11 Jun 2012)

Log Message

Theme Customizer: Remove background_image_thumb when saving settings. fixes #20871.

This prevents the background_image and background_image_thumb settings from getting out of sync.
In 3.5 we can consider using background-size on Appearance > Background, eliminating _thumb.

Modified Paths

Diff

Modified: trunk/wp-includes/class-wp-customize-manager.php (21052 => 21053)


--- trunk/wp-includes/class-wp-customize-manager.php	2012-06-11 20:34:42 UTC (rev 21052)
+++ trunk/wp-includes/class-wp-customize-manager.php	2012-06-11 20:49:45 UTC (rev 21053)
@@ -781,6 +781,10 @@
 			'theme_supports' => 'custom-background',
 		) );
 
+		$this->add_setting( new WP_Customize_Background_Image_Setting( $this, 'background_image_thumb', array(
+			'theme_supports' => 'custom-background',
+		) ) );
+
 		$this->add_control( new WP_Customize_Background_Image_Control( $this ) );
 
 		$this->add_setting( 'background_repeat', array(

Modified: trunk/wp-includes/class-wp-customize-setting.php (21052 => 21053)


--- trunk/wp-includes/class-wp-customize-setting.php	2012-06-11 20:34:42 UTC (rev 21052)
+++ trunk/wp-includes/class-wp-customize-setting.php	2012-06-11 20:49:45 UTC (rev 21053)
@@ -382,7 +382,7 @@
  *
  * Results should be properly handled using another setting or callback.
  */
-class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
+final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
 	public $id = 'header_image_data';
 
 	public function update( $value ) {
@@ -398,4 +398,12 @@
 		else
 			$custom_image_header->set_header_image( $value );
 	}
-}
\ No newline at end of file
+}
+
+final class WP_Customize_Background_Image_Setting extends WP_Customize_Setting {
+	public $id = 'background_image_thumb';
+
+	public function update( $value ) {
+		remove_theme_mod( 'background_image_thumb' );
+	}
+}