From a1e32d32171a15cfdeb50fb721015d85f966b3fe Mon Sep 17 00:00:00 2001
From: Mark Jaquith
Date: Wed, 13 Mar 2013 20:31:43 +0000
Subject: [PATCH] Add the ability to use HTML5 input types in the comment form.
props jorbin, georgestephanis, obenland. fixes #15080
git-svn-id: http://core.svn.wordpress.org/trunk@23689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-includes/comment-template.php | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 0569a75862..ec7aa4ce7e 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -1518,15 +1518,16 @@ function comment_form( $args = array(), $post_id = null ) {
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
- $req = get_option( 'require_name_email' );
+ $req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
- $fields = array(
+ $html5 = isset( $args['format'] ) && 'html5' === $args['format'];
+ $fields = array(
'author' => ' ' .
- '
' . - '
', + '', ); $required_text = sprintf( ' ' . __('Required fields are marked %s'), '*' ); @@ -1543,6 +1544,7 @@ function comment_form( $args = array(), $post_id = null ) { 'title_reply_to' => __( 'Leave a Reply to %s' ), 'cancel_reply_link' => __( 'Cancel reply' ), 'label_submit' => __( 'Post Comment' ), + 'format' => 'xhtml', ); $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) ); @@ -1556,7 +1558,7 @@ function comment_form( $args = array(), $post_id = null ) { -