Changeset 45088
- Timestamp:
- 04/01/2019 04:17:11 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
src/wp-includes/post-template.php (modified) (1 diff)
-
src/wp-includes/theme.php (modified) (1 diff)
-
tests/phpunit/tests/post/getBodyClass.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r44966 r45088 774 774 } 775 775 776 if ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) { 776 if ( current_theme_supports( 'custom-background' ) 777 && ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) ) { 777 778 $classes[] = 'custom-background'; 778 779 } -
trunk/src/wp-includes/theme.php
r44894 r45088 2731 2731 } 2732 2732 $support = get_theme_support( 'custom-background' ); 2733 remove_action( 'wp_head', $support[0]['wp-head-callback'] ); 2733 if ( isset( $support[0]['wp-head-callback'] ) ) { 2734 remove_action( 'wp_head', $support[0]['wp-head-callback'] ); 2735 } 2734 2736 remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); 2735 2737 unset( $GLOBALS['custom_background'] ); -
trunk/tests/phpunit/tests/post/getBodyClass.php
r44966 r45088 205 205 206 206 /** 207 * @ticket 38168 208 */ 209 public function test_custom_background_class_is_added_when_theme_supports_it() { 210 add_theme_support( 'custom-background', array( 'default-color', '#ffffff' ) ); 211 set_theme_mod( 'background_color', '#000000' ); 212 213 $class = get_body_class(); 214 $current_theme_supports_custom_background = current_theme_supports( 'custom-background' ); 215 216 remove_theme_mod( 'background_color' ); 217 remove_theme_support( 'custom-background' ); 218 219 $this->assertTrue( $current_theme_supports_custom_background ); 220 $this->assertContains( 'custom-background', $class ); 221 } 222 223 /** 224 * @ticket 38168 225 */ 226 public function test_custom_background_class_is_not_added_when_theme_support_is_missing() { 227 set_theme_mod( 'background_color', '#000000' ); 228 229 $class = get_body_class(); 230 $current_theme_supports_custom_background = current_theme_supports( 'custom-background' ); 231 232 remove_theme_mod( 'background_color' ); 233 234 $this->assertFalse( $current_theme_supports_custom_background ); 235 $this->assertNotContains( 'custom-background', $class ); 236 } 237 238 /** 207 239 * @ticket 44005 208 240 * @group privacy
Note: See TracChangeset
for help on using the changeset viewer.