WordPress.org

Make WordPress Core

Ticket #44342: 44342.diff

File 44342.diff, 2.3 KB (added by felipeelia, 17 months ago)
  • src/wp-includes/comment-template.php

     
    22622262        $req      = get_option( 'require_name_email' );
    22632263        $html_req = ( $req ? " required='required'" : '' );
    22642264        $html5    = 'html5' === $args['format'];
    2265         $consent  = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
    22662265        $fields   = array(
    22672266                'author'  => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    22682267                                         '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>',
     
    22702269                                         '<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>',
    22712270                'url'     => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
    22722271                                         '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
    2273                 'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    2274                                          '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>',
    22752272        );
    22762273
     2274        if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) ) {
     2275                $consent           = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
     2276                $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
     2277                                                         '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';
     2278        }
     2279
    22772280        $required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '<span class="required">*</span>' );
    22782281
    22792282        /**