From 59698190381ae1a600164f01531104980ccea997 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 6 Jun 2013 15:31:34 +0000 Subject: [PATCH] `add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form' ) );' props obenland. see #23850. git-svn-id: http://core.svn.wordpress.org/trunk@24417 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 7 +++++-- wp-includes/general-template.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index c6881b6797..3d32132146 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1506,7 +1506,7 @@ function wp_list_comments($args = array(), $comments = null ) { 'avatar_size' => 32, 'reverse_top_level' => null, 'reverse_children' => '', - 'format' => 'xhtml', // or html5 + 'format' => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml', 'short_ping' => false, ); @@ -1606,9 +1606,12 @@ function comment_form( $args = array(), $post_id = null ) { $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; + if ( ! isset( $args['format'] ) ) + $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml'; + $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); - $html5 = isset( $args['format'] ) && 'html5' === $args['format']; + $html5 = 'html5' === $args['format']; $fields = array( 'author' => '

' . ' ' . '

', diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 8b77af4ed2..f4475bd7db 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -155,7 +155,7 @@ function get_template_part( $slug, $name = null ) { function get_search_form( $echo = true ) { do_action( 'pre_get_search_form' ); - $format = ( current_theme_supports( 'html5-search-form' ) ) ? 'html5' : 'xhtml'; + $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml'; $format = apply_filters( 'search_form_format', $format ); $search_form_template = locate_template( 'searchform.php' );