Respect the commenter decision when they have checked the checkbox to consent to cookies, and keep it checked when they reload the page or post another comment.

See #43436.
Built from https://develop.svn.wordpress.org/trunk@42815


git-svn-id: http://core.svn.wordpress.org/trunk@42645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2018-03-09 15:57:30 +00:00
parent b93dfd3571
commit 63dd79d908
2 changed files with 3 additions and 2 deletions

View File

@ -2260,6 +2260,7 @@ function comment_form( $args = array(), $post_id = null ) {
$req = get_option( 'require_name_email' );
$html_req = ( $req ? " required='required'" : '' );
$html5 = 'html5' === $args['format'];
$consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
$fields = array(
'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>',
@ -2268,7 +2269,7 @@ function comment_form( $args = array(), $post_id = null ) {
'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
'<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
'cookies' => '<p class="comment-form-cookies-consent"><label for="wp-comment-cookies-consent">' .
'<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" />' .
'<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
__( 'Save my name, email, and site URL in my browser for next time I post a comment.' ) . '</label></p>',
);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42814';
$wp_version = '5.0-alpha-42815';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.