mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 19:24:34 +00:00
Add a checkbox to the comment form so logged out users can opt-out of commenter cookies.
Props lakenh, xkon, birgire, azaozz. See #43436. git-svn-id: https://develop.svn.wordpress.org/trunk@42772 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -38,16 +38,18 @@ if ( is_wp_error( $comment ) ) {
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
$cookies_consent = ( isset( $_POST['wp-comment-cookies-consent'] ) );
|
||||
|
||||
/**
|
||||
* Perform other actions when comment cookies are set.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*
|
||||
* @param WP_Comment $comment Comment object.
|
||||
* @param WP_User $user User object. The user may not exist.
|
||||
* @param WP_Comment $comment Comment object.
|
||||
* @param WP_User $user User object. The user may not exist.
|
||||
* @param boolean $cookies_consent Whether the user has opted-in commenter cookies.
|
||||
*/
|
||||
do_action( 'set_comment_cookies', $comment, $user );
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user