Ticket #27278: 27278.5.diff
File 27278.5.diff, 1.9 KB (added by , 11 years ago) |
---|
-
src/wp-includes/theme.php
1379 1379 * The init hook may be too late for some features. 1380 1380 * 1381 1381 * @since 2.9.0 1382 * 1382 1383 * @param string $feature the feature being added 1384 * @return void|bool False if trying to add html5 support and not passing an array as 2nd argument 1383 1385 */ 1384 1386 function add_theme_support( $feature ) { 1385 1387 global $_wp_theme_features; … … 1398 1400 case 'html5' : 1399 1401 // You can't just pass 'html5', you need to pass an array of types. 1400 1402 if ( empty( $args[0] ) ) { 1401 $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) ); 1403 _doing_it_wrong( "add_theme_support( 'html5' )", 'You need to pass an array of types.', '3.6.1' ); 1404 $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) ); // Back compat 1402 1405 } elseif ( ! is_array( $args[0] ) ) { 1403 1406 _doing_it_wrong( "add_theme_support( 'html5' )", 'You need to pass an array of types.', '3.6.1' ); 1404 1407 return false; -
tests/phpunit/tests/theme/support.php
80 80 81 81 /** 82 82 * @ticket 24932 83 * 84 * @expectedIncorrectUsage add_theme_support( 'html5' ) 83 85 */ 84 86 function test_supports_html5() { 85 87 remove_theme_support( 'html5' ); … … 90 92 $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); 91 93 $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) ); 92 94 $this->assertTrue( current_theme_supports( 'html5', 'search-form' ) ); 95 $this->assertFalse( current_theme_supports( 'html5', 'gallery' ) ); 93 96 $this->assertFalse( current_theme_supports( 'html5', 'something-else' ) ); 94 97 } 95 98