better solution based on core

This commit is contained in:
Ernesto Ruge 2018-05-26 10:43:34 +02:00 committed by GitHub
parent ece50c2b28
commit a5dbc3c877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ if ( ! function_exists( 'understrap_bootstrap_comment_form_fields' ) ) {
$req = get_option( 'require_name_email' ); $req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' ); $aria_req = ( $req ? " aria-required='true'" : '' );
$html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0; $html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0;
$consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
$fields = array( $fields = array(
'author' => '<div class="form-group comment-form-author"><label for="author">' . __( 'Name', 'author' => '<div class="form-group comment-form-author"><label for="author">' . __( 'Name',
'understrap' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 'understrap' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
@ -33,7 +34,7 @@ if ( ! function_exists( 'understrap_bootstrap_comment_form_fields' ) ) {
'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website', 'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website',
'understrap' ) . '</label> ' . 'understrap' ) . '</label> ' .
'<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30"></div>', '<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30"></div>',
'cookies' => '<div class="form-group form-check comment-form-cookies-consent"><input class="form-check-input" id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" /> ' . 'cookies' => '<div class="form-group form-check comment-form-cookies-consent"><input class="form-check-input" id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' /> ' .
'<label class="form-check-label" for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></div>', '<label class="form-check-label" for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></div>',
); );