Ticket #27278: 27278.1.diff
File 27278.1.diff, 1.5 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 (empty 2nd arg works but is discouraged) 1383 1385 */ 1384 1386 function add_theme_support( $feature ) { 1385 1387 global $_wp_theme_features; … … 1397 1399 1398 1400 case 'html5' : 1399 1401 // You can't just pass 'html5', you need to pass an array of types. 1402 // Note: as of 3.9.0 core supports the types 'comment-list', 'comment-form', 'search-form' and 'gallery' 1400 1403 if ( empty( $args[0] ) ) { 1401 1404 $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) ); 1402 1405 } elseif ( ! is_array( $args[0] ) ) { -
tests/phpunit/tests/theme/support.php
90 90 $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) ); 91 91 $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) ); 92 92 $this->assertTrue( current_theme_supports( 'html5', 'search-form' ) ); 93 $this->assertFalse( current_theme_supports( 'html5', 'gallery' ) ); 93 94 $this->assertFalse( current_theme_supports( 'html5', 'something-else' ) ); 94 95 } 95 96