comment_cookie_lifetime
Filters the lifetime of the comment cookie in seconds.
Usage
add_filter( 'comment_cookie_lifetime', 'wp_kama_comment_cookie_lifetime_filter' );
/**
* Function for `comment_cookie_lifetime` filter-hook.
*
* @param int $seconds Comment cookie lifetime.
*
* @return int
*/
function wp_kama_comment_cookie_lifetime_filter( $seconds ){
// filter...
return $seconds;
}
- $seconds(int)
- Comment cookie lifetime.
Default: YEAR_IN_SECONDS
Changelog
| Since 2.8.0 | Introduced. |
| Since 6.6.0 | The default $seconds value changed from 30000000 to YEAR_IN_SECONDS. |
Where the hook is called
comment_cookie_lifetime
wp-includes/comment.php 605
$comment_cookie_lifetime = time() + apply_filters( 'comment_cookie_lifetime', YEAR_IN_SECONDS );