Changeset 25235
- Timestamp:
- 09/04/2013 05:43:29 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r25193 r25235 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 $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) ); 1278 } elseif ( ! is_array( $args[0] ) ) { 1279 _doing_it_wrong( "add_theme_support( 'html5' )", 'You need to pass an array of types.', '3.6.1' ); 1277 1280 return false; 1281 } 1278 1282 1279 1283 // Calling 'html5' again merges, rather than overwrites. -
trunk/tests/phpunit/tests/theme/support.php
r25193 r25235 86 86 $this->assertFalse( current_theme_supports( 'html5' ) ); 87 87 $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); 88 $this->assertFalse( add_theme_support( 'html5' ) ); 89 $this->assertFalse( current_theme_supports( 'html5' ) ); 90 $this->assertFalse( 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 $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) ); 92 $this->assertTrue( current_theme_supports( 'html5', 'search-form' ) ); 93 $this->assertFalse( current_theme_supports( 'html5', 'something-else' ) ); 91 94 } 92 95 … … 107 110 108 111 // 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' ) ) );112 $this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) ); 113 $this->assertNotSame( false, add_theme_support( 'html5', array( 'comment-list' ) ) ); 111 114 $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); 112 $this->assertTrue( current_theme_supports( 'html5', 'comment s-list' ) );115 $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) ); 113 116 $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) ); 114 117 115 118 // Removal is all or nothing. 116 119 $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' ) );120 $this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) ); 121 $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); 119 122 $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) ); 123 } 124 125 /** 126 * @ticket 24932 127 */ 128 function test_supports_html5_invalid() { 129 remove_theme_support( 'html5' ); 130 $this->assertFalse( add_theme_support( 'html5', 'comment-form' ) ); 131 $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) ); 132 $this->assertFalse( current_theme_supports( 'html5' ) ); 120 133 } 121 134
Note: See TracChangeset
for help on using the changeset viewer.