]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/theme.php
WordPress 3.6.1
[autoinstalls/wordpress.git] / wp-includes / theme.php
index a1dec2634e8f4b9fac44db5e277c91b40fe2cdb5..b583f524212e66fa53209840649a149956ea4597 100644 (file)
@@ -1264,6 +1264,20 @@ function add_theme_support( $feature ) {
                                $args[0] = array_intersect( $args[0], array_keys( get_post_format_slugs() ) );
                        break;
 
                                $args[0] = array_intersect( $args[0], array_keys( get_post_format_slugs() ) );
                        break;
 
+               case 'html5' :
+                       // You can't just pass 'html5', you need to pass an array of types.
+                       if ( empty( $args[0] ) ) {
+                               $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) );
+                       } elseif ( ! is_array( $args[0] ) ) {
+                               _doing_it_wrong( "add_theme_support( 'html5' )", 'You need to pass an array of types.', '3.6.1' );
+                               return false;
+                       }
+
+                       // Calling 'html5' again merges, rather than overwrites.
+                       if ( isset( $_wp_theme_features['html5'] ) )
+                               $args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] );
+                       break;
+
                case 'custom-header-uploads' :
                        return add_theme_support( 'custom-header', array( 'uploads' => true ) );
                        break;
                case 'custom-header-uploads' :
                        return add_theme_support( 'custom-header', array( 'uploads' => true ) );
                        break;
@@ -1547,11 +1561,15 @@ function current_theme_supports( $feature ) {
                        return in_array( $content_type, $_wp_theme_features[$feature][0] );
                        break;
 
                        return in_array( $content_type, $_wp_theme_features[$feature][0] );
                        break;
 
+               case 'html5':
                case 'post-formats':
                        // specific post formats can be registered by passing an array of types to
                        // add_theme_support()
                case 'post-formats':
                        // specific post formats can be registered by passing an array of types to
                        // add_theme_support()
-                       $post_format = $args[0];
-                       return in_array( $post_format, $_wp_theme_features[$feature][0] );
+
+                       // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
+
+                       $type = $args[0];
+                       return in_array( $type, $_wp_theme_features[$feature][0] );
                        break;
 
                case 'custom-header':
                        break;
 
                case 'custom-header':