Make WordPress Core

Ticket #27278: 27278.1.diff

File 27278.1.diff, 1.5 KB (added by jond3r, 11 years ago)
  • src/wp-includes/theme.php

     
    13791379 * The init hook may be too late for some features.
    13801380 *
    13811381 * @since 2.9.0
     1382 *
    13821383 * @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)
    13831385 */
    13841386function add_theme_support( $feature ) {
    13851387        global $_wp_theme_features;
     
    13971399
    13981400                case 'html5' :
    13991401                        // 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'
    14001403                        if ( empty( $args[0] ) ) {
    14011404                                $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) );
    14021405                        } elseif ( ! is_array( $args[0] ) ) {
  • tests/phpunit/tests/theme/support.php

     
    9090                $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) );
    9191                $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) );
    9292                $this->assertTrue( current_theme_supports( 'html5', 'search-form' ) );
     93                $this->assertFalse( current_theme_supports( 'html5', 'gallery' ) );
    9394                $this->assertFalse( current_theme_supports( 'html5', 'something-else' ) );
    9495        }
    9596