Make WordPress Core

Changeset 42849


Ignore:
Timestamp:
03/18/2018 04:44:43 PM (7 years ago)
Author:
ocean90
Message:

Comments: Remove unnecessary aria-required attribute from comment_form(), added with the function in [12810].

At the time, having both required and aria-required meant a wider range of support for browsers and assistive technology. Today, it's safe to use just required.

Merge of [42758] to the 4.9 branch.

Props lakenh, afercia, davidakennedy, henry.wright.
Fixes #39045.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/comment-template.php

    r41285 r42849  
    21932193
    21942194    $req      = get_option( 'require_name_email' );
    2195     $aria_req = ( $req ? " aria-required='true'" : '' );
    21962195    $html_req = ( $req ? " required='required'" : '' );
    21972196    $html5    = 'html5' === $args['format'];
    21982197    $fields   =  array(
    21992198        'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    2200                     '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
     2199                    '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>',
    22012200        'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    2202                     '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
     2201                    '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $html_req  . ' /></p>',
    22032202        'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
    22042203                    '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
     
    22172216    $defaults = array(
    22182217        'fields'               => $fields,
    2219         'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
     2218        'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p>',
    22202219        /** This filter is documented in wp-includes/link-template.php */
    22212220        'must_log_in'          => '<p class="must-log-in">' . sprintf(
Note: See TracChangeset for help on using the changeset viewer.