Ticket #24932: 24932.2.diff
File 24932.2.diff, 2.8 KB (added by , 11 years ago) |
---|
-
src/wp-includes/theme.php
1273 1273 1274 1274 case 'html5' : 1275 1275 // You can't just pass 'html5', you need to pass an array of types. 1276 if ( ! is_array( $args[0] ) ) 1276 if ( empty( $args[0] ) ) { 1277 _doing_it_wrong( __FUNCTION__, 'You need to pass an array of types.', '3.7' ); 1278 $args = array( array( 'comment-list', 'comment-form', 'search-form' ) ); 1279 } elseif ( ! is_array( $args[0] ) ) { 1280 _doing_it_wrong( __FUNCTION__, 'You need to pass an array of types.', '3.7' ); 1277 1281 return false; 1282 } 1278 1283 1279 1284 // Calling 'html5' again merges, rather than overwrites. 1280 1285 if ( isset( $_wp_theme_features['html5'] ) ) -
tests/phpunit/tests/theme/support.php
85 85 remove_theme_support( 'html5' ); 86 86 $this->assertFalse( current_theme_supports( 'html5' ) ); 87 87 $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); 88 $this->assert False(add_theme_support( 'html5' ) );89 $this->assert False( current_theme_supports( 'html5' ) );90 $this->assert False( current_theme_supports( 'html5', 'comment-form' ) );88 $this->assertNotSame( false, add_theme_support( 'html5' ) ); 89 $this->assertTrue( current_theme_supports( 'html5' ) ); 90 $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); 91 91 } 92 92 93 93 /** … … 106 106 $this->assertTrue( current_theme_supports( 'html5' ) ); 107 107 108 108 // It appends, rather than replaces. 109 $this->assertFalse( current_theme_supports( 'html5', 'comment s-list' ) );110 $this->assertNotSame( false, add_theme_support( 'html5', array( 'comment s-list' ) ) );109 $this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) ); 110 $this->assertNotSame( false, add_theme_support( 'html5', array( 'comment-list' ) ) ); 111 111 $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); 112 $this->assertTrue( current_theme_supports( 'html5', 'comment s-list' ) );112 $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) ); 113 113 $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) ); 114 114 115 115 // Removal is all or nothing. 116 116 $this->assertTrue( remove_theme_support( 'html5' ) ); 117 $this->assertFalse( current_theme_supports( 'html5', 'comment s-list' ) );118 $this->assertFalse( current_theme_supports( 'html5', 'comment s-form' ) );117 $this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) ); 118 $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); 119 119 $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) ); 120 120 } 121 121