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.



git-svn-id: http://core.svn.wordpress.org/trunk@21053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-06-11 20:49:45 +00:00
parent 7c214624b6
commit 2d07cd3fc5
2 changed files with 14 additions and 2 deletions

View File

@ -781,6 +781,10 @@ final class WP_Customize_Manager {
'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(

View File

@ -382,7 +382,7 @@ class WP_Customize_Filter_Setting extends WP_Customize_Setting {
*
* 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 @@ class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
else
$custom_image_header->set_header_image( $value );
}
}
}
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' );
}
}