Ticket #20448: 20448.7.diff
File 20448.7.diff, 2.0 KB (added by , 13 years ago) |
---|
-
wp-includes/post-template.php
501 501 if ( is_admin_bar_showing() ) 502 502 $classes[] = 'admin-bar'; 503 503 504 if ( get_theme_mod( 'background_image' ) || get_theme_mod( 'background_color' ) || 505 ( '_custom_background_cb' != get_theme_support( 'custom-background', 'wp-head-callback' ) 506 && ( get_theme_support( 'custom-background', 'default-image' ) || 507 get_theme_support( 'custom-background', 'default-color' ) ) ) ) 504 if ( get_background_image() || get_background_color() ) 508 505 $classes[] = 'custom-background'; 509 506 510 507 $page = $wp_query->get( 'page' ); -
wp-includes/theme.php
1063 1063 * @return string 1064 1064 */ 1065 1065 function get_background_image() { 1066 return get_theme_mod('background_image', get_theme_support( 'custom-background', 'default-image' ) ); 1066 $bg = get_theme_mod('background_image', false ); 1067 if ( false !== $bg ) 1068 return $bg; 1069 1070 return sprintf( get_theme_support( 'custom-background', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() ) ; 1067 1071 } 1068 1072 1069 1073 /** … … 1102 1106 * @access protected 1103 1107 */ 1104 1108 function _custom_background_cb() { 1105 $background = get_ theme_mod( 'background_image');1106 $color = get_ theme_mod( 'background_color');1109 $background = get_background_image(); 1110 $color = get_background_color(); 1107 1111 1108 1112 if ( ! $background && ! $color ) 1109 1113 return; … … 1129 1133 $attachment = " background-attachment: $attachment;"; 1130 1134 1131 1135 $style .= $image . $repeat . $position . $attachment; 1136 } else if ( '' === $background && get_theme_support( 'custom-background', 'default-image' ) ) { 1137 $image = " background-image: none;"; 1138 $style .= $image; 1132 1139 } 1133 1140 ?> 1134 1141 <style type="text/css" id="custom-background-css">