Comments: Ensure that unmoderated comments won't be search indexed.
After a comment is submitted, only allow a brief window where the comment is live on the site. Fixes #49956. Props: jonkolbert, ayeshrajans, Asif2BD, peterwilsoncc, imath, audrasjb, jonoaldersonwp, whyisjake. Built from https://develop.svn.wordpress.org/trunk@47887 git-svn-id: http://core.svn.wordpress.org/trunk@47661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -56,8 +56,8 @@ do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );
|
||||
|
||||
$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID;
|
||||
|
||||
// Add specific query arguments to display the awaiting moderation message.
|
||||
if ( 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {
|
||||
// If user didn't consent to cookies, add specific query arguments to display the awaiting moderation message.
|
||||
if ( ! $cookies_consent && 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {
|
||||
$location = add_query_arg(
|
||||
array(
|
||||
'unapproved' => $comment->comment_ID,
|
||||
|
||||
Reference in New Issue
Block a user