Ticket #4332: comment-template.php.diff
File comment-template.php.diff, 3.8 KB (added by , 12 years ago) |
---|
-
wp-includes/comment-template.php
1610 1610 $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml'; 1611 1611 1612 1612 $req = get_option( 'require_name_email' ); 1613 $ aria_req = ( $req ? " aria-required='true'" : '' );1613 $req_attr = ( $req ? " aria-required='true' required=''" : '' ); 1614 1614 $html5 = 'html5' === $args['format']; 1615 1615 $fields = array( 1616 1616 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 1617 '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $ aria_req. ' /></p>',1617 '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $req_attr . ' /></p>', 1618 1618 'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 1619 '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $ aria_req. ' /></p>',1619 '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $req_attr . ' /></p>', 1620 1620 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' . 1621 1621 '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>', 1622 1622 ); … … 1624 1624 $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' ); 1625 1625 $defaults = array( 1626 1626 'fields' => apply_filters( 'comment_form_default_fields', $fields ), 1627 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" ></textarea></p>',1627 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required=""></textarea></p>', 1628 1628 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 1629 1629 'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 1630 1630 'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>', … … 1649 1649 <?php echo $args['must_log_in']; ?> 1650 1650 <?php do_action( 'comment_form_must_log_in_after' ); ?> 1651 1651 <?php else : ?> 1652 <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="comment-form" <?php echo $html5 ? ' novalidate' : ''; ?>>1652 <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="comment-form"> 1653 1653 <?php do_action( 'comment_form_top' ); ?> 1654 1654 <?php if ( is_user_logged_in() ) : ?> 1655 1655 <?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>