From db1ace58caabb2aa53ce609cae555521e237be88 Mon Sep 17 00:00:00 2001
From: Scott Taylor
Date: Fri, 16 Jan 2015 15:55:50 +0000
Subject: [PATCH] In `comment_form()`, add the HTML5 `required` attribute next
to `aria-required` in fields that utilize it.
Props MMN-o.
Fixes #24732.
git-svn-id: https://develop.svn.wordpress.org/trunk@31204 602fd350-edb4-49c9-b593-d223f7449a82
---
src/wp-includes/comment-template.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
index b6dff4e527..1c54a45310 100644
--- a/src/wp-includes/comment-template.php
+++ b/src/wp-includes/comment-template.php
@@ -2176,12 +2176,13 @@ function comment_form( $args = array(), $post_id = null ) {
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
+ $html_req = ( $req ? " required='required'" : '' );
$html5 = 'html5' === $args['format'];
$fields = array(
'author' => '',
+ '
',
'email' => '',
+ '',
'url' => '',
);
@@ -2198,7 +2199,7 @@ function comment_form( $args = array(), $post_id = null ) {
$fields = apply_filters( 'comment_form_default_fields', $fields );
$defaults = array(
'fields' => $fields,
- 'comment_field' => '',
+ 'comment_field' => '',
/** This filter is documented in wp-includes/link-template.php */
'must_log_in' => '' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
/** This filter is documented in wp-includes/link-template.php */