Make WordPress Core

Ticket #44294: move_comment_labels_after_inputs_for_consistency.diff

File move_comment_labels_after_inputs_for_consistency.diff, 3.4 KB (added by silb3r, 8 years ago)

Make all comment form field markup order consistent

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

     
    22642264        $html5    = 'html5' === $args['format'];
    22652265        $consent  = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
    22662266        $fields   = array(
    2267                 'author'  => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    2268                                          '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>',
    2269                 'email'   => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    2270                                          '<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>',
    2271                 'url'     => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
    2272                                          '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
     2267                'author'  => '<p class="comment-form-author"><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' />' .
     2268                                         '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label></p>',
     2269                'email'   => '<p class="comment-form-email"><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 . ' />' .
     2270                                         '<label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label></p>',
     2271                'url'     => '<p class="comment-form-url"><input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" />' .
     2272                                         '<label for="url">' . __( 'Website' ) . '</label></p>',
    22732273                'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    22742274                                         '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>',
    22752275        );
     
    22862286        $fields   = apply_filters( 'comment_form_default_fields', $fields );
    22872287        $defaults = array(
    22882288                'fields'               => $fields,
    2289                 '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>',
     2289                'comment_field'        => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea><label for="comment">' . _x( 'Comment', 'noun' ) . '</label></p>',
    22902290                /** This filter is documented in wp-includes/link-template.php */
    22912291                'must_log_in'          => '<p class="must-log-in">' . sprintf(
    22922292                        /* translators: %s: login URL */