Skip to content

Instantly share code, notes, and snippets.

@nathanrice
Created August 2, 2013 20:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanrice/6143003 to your computer and use it in GitHub Desktop.
Save nathanrice/6143003 to your computer and use it in GitHub Desktop.
Unit test for HTML5 support in WordPress 3.6
<?php
//* Only turn on HTML5 for comment list
add_theme_support( 'html5', array( 'comment-list' ) );
<?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";
@nathanrice
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment