mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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
This commit is contained in:
parent
ac64f38b66
commit
2fa1194a75
@ -2371,7 +2371,7 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
( $req ? $required_indicator : '' )
|
||||
),
|
||||
sprintf(
|
||||
'<input id="author" name="author" type="text" value="%s" size="30" maxlength="245"%s />',
|
||||
'<input id="author" name="author" type="text" value="%s" size="30" maxlength="245" autocomplete="name"%s />',
|
||||
esc_attr( $commenter['comment_author'] ),
|
||||
( $req ? $required_attribute : '' )
|
||||
)
|
||||
@ -2384,7 +2384,7 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
( $req ? $required_indicator : '' )
|
||||
),
|
||||
sprintf(
|
||||
'<input id="email" name="email" %s value="%s" size="30" maxlength="100" aria-describedby="email-notes"%s />',
|
||||
'<input id="email" name="email" %s value="%s" size="30" maxlength="100" aria-describedby="email-notes" autocomplete="email"%s />',
|
||||
( $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(
|
||||
'<input id="url" name="url" %s value="%s" size="30" maxlength="200" />',
|
||||
'<input id="url" name="url" %s value="%s" size="30" maxlength="200" autocomplete="url" />',
|
||||
( $html5 ? 'type="url"' : 'type="text"' ),
|
||||
esc_attr( $commenter['comment_author_url'] )
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user