From 2fa1194a75fb77e8958c6b2e808d4c899fa7bd3a Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Fri, 24 Jun 2022 21:24:18 +0000 Subject: [PATCH] Comments: Add contextual `autocomplete` attributes to comment form fields. For accessibility, input fields should identify their "purpose". The HTML5 attribute `autocomplete` allows for various user data to be quickly autofilled while adding context for some assistive technologies. This commit adds the appropriate autofill purposes for an author's name, email, and website URL in the comment form template. Props juliemoynat, bhrugesh96, sabernhardt. Fixes #55779. git-svn-id: https://develop.svn.wordpress.org/trunk@53576 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment-template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index 9572333f27..fcbd51c894 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -2371,7 +2371,7 @@ function comment_form( $args = array(), $post_id = null ) { ( $req ? $required_indicator : '' ) ), sprintf( - '', + '', esc_attr( $commenter['comment_author'] ), ( $req ? $required_attribute : '' ) ) @@ -2384,7 +2384,7 @@ function comment_form( $args = array(), $post_id = null ) { ( $req ? $required_indicator : '' ) ), sprintf( - '', + '', ( $html5 ? 'type="email"' : 'type="text"' ), esc_attr( $commenter['comment_author_email'] ), ( $req ? $required_attribute : '' ) @@ -2397,7 +2397,7 @@ function comment_form( $args = array(), $post_id = null ) { __( 'Website' ) ), sprintf( - '', + '', ( $html5 ? 'type="url"' : 'type="text"' ), esc_attr( $commenter['comment_author_url'] ) )