From b95b9917f1967ccbc9a58a213085ca6fcd010785 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: https://develop.svn.wordpress.org/trunk@23689 602fd350-edb4-49c9-b593-d223f7449a82
---
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' => '',
'email' => '',
+ '
',
'url' => '',
+ '',
);
$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 ) {
-