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:
parent
7c214624b6
commit
2d07cd3fc5
|
@ -781,6 +781,10 @@ final class WP_Customize_Manager {
|
||||||
'theme_supports' => 'custom-background',
|
'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_control( new WP_Customize_Background_Image_Control( $this ) );
|
||||||
|
|
||||||
$this->add_setting( 'background_repeat', array(
|
$this->add_setting( 'background_repeat', array(
|
||||||
|
|
|
@ -382,7 +382,7 @@ class WP_Customize_Filter_Setting extends WP_Customize_Setting {
|
||||||
*
|
*
|
||||||
* Results should be properly handled using another setting or callback.
|
* 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 $id = 'header_image_data';
|
||||||
|
|
||||||
public function update( $value ) {
|
public function update( $value ) {
|
||||||
|
@ -399,3 +399,11 @@ class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
|
||||||
$custom_image_header->set_header_image( $value );
|
$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' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue