Make WordPress Core

Changeset 21053


Ignore:
Timestamp:
06/11/2012 08:49:45 PM (14 years ago)
Author:
nacin
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.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize-manager.php

    r21037 r21053  
    781781                        'theme_supports' => 'custom-background',
    782782                ) );
     783
     784                $this->add_setting( new WP_Customize_Background_Image_Setting( $this, 'background_image_thumb', array(
     785                        'theme_supports' => 'custom-background',
     786                ) ) );
    783787
    784788                $this->add_control( new WP_Customize_Background_Image_Control( $this ) );
  • trunk/wp-includes/class-wp-customize-setting.php

    r21037 r21053  
    383383 * Results should be properly handled using another setting or callback.
    384384 */
    385 class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
     385final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
    386386        public $id = 'header_image_data';
    387387
     
    400400        }
    401401}
     402
     403final class WP_Customize_Background_Image_Setting extends WP_Customize_Setting {
     404        public $id = 'background_image_thumb';
     405
     406        public function update( $value ) {
     407                remove_theme_mod( 'background_image_thumb' );
     408        }
     409}
Note: See TracChangeset for help on using the changeset viewer.