set_comment_cookies WordPress Action Hook

The set_comment_cookies hook is used to set cookies on the user's computer when they leave a comment on a WordPress site. This allows the WordPress site to remember the user's information when they return to the site to leave another comment.

do_action( 'set_comment_cookies', WP_Comment $comment, WP_User $user, bool $cookies_consent ) #

Perform other actions when comment cookies are set.


Parameters

$comment

(WP_Comment)Comment object.

$user

(WP_User)Comment author's user object. The user may not exist.

$cookies_consent

(bool)Comment author's consent to store cookies.


Top ↑

Source

File: wp-comments-post.php

View on Trac


Top ↑

Changelog

Changelog
VersionDescription
4.9.6The $cookies_consent parameter was added.
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.