set_comment_cookies
Fires after comment cookies are set.
Usage
add_action( 'set_comment_cookies', 'wp_kama_set_comment_cookies_action', 10, 3 ); /** * Function for `set_comment_cookies` action-hook. * * @param WP_Comment $comment Comment object. * @param WP_User $user Comment author's user object. The user may not exist. * @param bool $cookies_consent Comment author's consent to store cookies. * * @return void */ function wp_kama_set_comment_cookies_action( $comment, $user, $cookies_consent ){ // action... }
- $comment(WP_Comment)
- Comment object.
- $user(WP_User)
- Comment author's user object. The user may not exist.
- $cookies_consent(true|false)
- Comment author's consent to store cookies.
Changelog
Since 3.4.0 | Introduced. |
Since 4.9.6 | The $cookies_consent parameter was added. |
Where the hook is called
In file: /wp-comments-post.php
set_comment_cookies
wp-comments-post.php 55
do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );
Where the hook is used in WordPress
wp-includes/default-filters.php 408
add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 3 );