From b363ace996ab6b54e1d7a3b978093ec522a54eb6 Mon Sep 17 00:00:00 2001
From: Andrew Ozz
Date: Thu, 28 Jun 2018 02:39:57 +0000
Subject: [PATCH] Privacy: do not show the comment cookies opt-in checkbox (on
the front-end comments form) when comment cookies are disabled.
Props felipeelia, johnbillion.
Fixes #44342.
Built from https://develop.svn.wordpress.org/trunk@43370
git-svn-id: http://core.svn.wordpress.org/trunk@43198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-includes/comment-template.php | 9 ++++++---
wp-includes/version.php | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index f7626f5389..649f29a10b 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -2262,7 +2262,6 @@ 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' => '',
@@ -2270,10 +2269,14 @@ function comment_form( $args = array(), $post_id = null ) {
'
',
'url' => '',
- 'cookies' => '',
);
+ if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) ) {
+ $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
+ $fields['cookies'] = '';
+ }
+
$required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '*' );
/**
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 011f9cf804..508577529f 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.0-alpha-43369';
+$wp_version = '5.0-alpha-43370';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.