public
Created

Unit test for HTML5 support in WordPress 3.6

  • Download Gist
functions.php
PHP
1 2 3 4
<?php
 
//* Only turn on HTML5 for comment list
add_theme_support( 'html5', array( 'comment-list' ) );
index.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
 
if ( current_theme_supports( 'html5' ) )
echo 'Supports HTML5' . "\n";
 
if ( current_theme_supports( 'html5', 'comment-list' ) )
echo 'Supports HTML5 comment list.' . "\n";
if ( current_theme_supports( 'html5', 'search-form' ) )
echo 'Supports HTML5 search form.' . "\n";
 
if ( current_theme_supports( 'html5', 'comment-form' ) )
echo 'Supports HTML5 comment form.' . "\n";

Result: all 4 conditionals return true and echo their success. Which is, technically, not supposed to happen. Considering WP 3.6 uses the comment form check here:

http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-includes/comment-template.php.source.html#l1610

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.