Fix removing the default background image for themes that hard-code the default in css. Honor the default background image for themes that do not provide a fallback in css.
* <style> will appear if there is a default image registered. This is the same as 3.3. * If only a default color is registered, it still assumes it is in the stylesheet, and no <style> will appear. This is a change from 3.3. * <style> will continue to appear as before if there is a custom background color or image. This is the same as 3.3. * This then allows for a default background image with background-image: none, overriding style.css. This is new. Props nacin see #20448 git-svn-id: http://core.svn.wordpress.org/trunk@21001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
05393d38f0
commit
64e6663569
|
@ -501,10 +501,7 @@ function get_body_class( $class = '' ) {
|
|||
if ( is_admin_bar_showing() )
|
||||
$classes[] = 'admin-bar';
|
||||
|
||||
if ( get_theme_mod( 'background_image' ) || get_theme_mod( 'background_color' ) ||
|
||||
( '_custom_background_cb' != get_theme_support( 'custom-background', 'wp-head-callback' )
|
||||
&& ( get_theme_support( 'custom-background', 'default-image' ) ||
|
||||
get_theme_support( 'custom-background', 'default-color' ) ) ) )
|
||||
if ( get_background_color() || get_theme_mod( 'background_image' ) || get_theme_support( 'custom-background', 'default-image' ) )
|
||||
$classes[] = 'custom-background';
|
||||
|
||||
$page = $wp_query->get( 'page' );
|
||||
|
|
|
@ -1102,10 +1102,10 @@ function background_color() {
|
|||
* @access protected
|
||||
*/
|
||||
function _custom_background_cb() {
|
||||
$background = get_theme_mod( 'background_image' );
|
||||
$background = get_background_image();
|
||||
$color = get_theme_mod( 'background_color' );
|
||||
|
||||
if ( ! $background && ! $color )
|
||||
if ( ! $background && ! $color && ! get_theme_support( 'custom-background', 'default-image' ) )
|
||||
return;
|
||||
|
||||
$style = $color ? "background-color: #$color;" : '';
|
||||
|
@ -1129,6 +1129,8 @@ function _custom_background_cb() {
|
|||
$attachment = " background-attachment: $attachment;";
|
||||
|
||||
$style .= $image . $repeat . $position . $attachment;
|
||||
} elseif ( get_theme_support( 'custom-background', 'default-image' ) ) {
|
||||
$style .= " background-image: none;";
|
||||
}
|
||||
?>
|
||||
<style type="text/css" id="custom-background-css">
|
||||
|
|
Loading…
Reference in New Issue