Ticket #20448: 20448.11.diff
File 20448.11.diff, 1.8 KB (added by , 13 years ago) |
---|
-
wp-includes/class-wp-customize-manager.php
752 752 'theme_supports' => 'custom-background', 753 753 ) ); 754 754 755 $this->add_setting( 'background_image_has_default', array( 756 'default' => (bool) get_theme_support( 'custom-background', 'default-image' ), 757 'theme_supports' => 'custom-background', 758 ) ); 759 755 760 $this->add_control( new WP_Customize_Background_Image_Control( $this ) ); 756 761 757 762 $this->add_setting( 'background_repeat', array( -
wp-includes/js/customize-preview.dev.js
109 109 return; 110 110 111 111 update = function() { 112 var css = '' ;112 var css = '', has_default = api.settings.values.background_image_has_default; 113 113 114 114 // The body will support custom backgrounds if either 115 115 // the color or image are set. 116 116 // 117 117 // See get_body_class() in /wp-includes/post-template.php 118 body.toggleClass( 'custom-background', !! ( color() || image() ) );118 body.toggleClass( 'custom-background', !! ( color() || image() || has_default ) ); 119 119 120 120 if ( color() ) 121 121 css += 'background-color: ' + color() + ';'; … … 125 125 css += 'background-position: top ' + position_x() + ';'; 126 126 css += 'background-repeat: ' + repeat() + ';'; 127 127 css += 'background-position: top ' + attachment() + ';'; 128 } else if ( has_default ) { 129 css += 'background-image: none;'; 128 130 } 129 131 130 132 // Refresh the stylesheet by removing and recreating it.