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.
Contents
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.
Source
File: wp-comments-post.php
Changelog
Version | Description |
---|---|
4.9.6 | The $cookies_consent parameter was added. |
3.4.0 | Introduced. |