comment_cookie_lifetime

comment_cookie_lifetime

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('comment_cookie_lifetime') is found 1 times:

  • /wp-includes/comment.php line 565
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    * @since 6.6.0 The default $seconds value changed from 30000000 to YEAR_IN_SECONDS.
     *
     * @param int $seconds Comment cookie lifetime. Default YEAR_IN_SECONDS.
     */
    $comment_cookie_lifetime = time() + apply_filters( 'comment_cookie_lifetime', YEAR_IN_SECONDS );
     
    $secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
     
    setcookie( 'comment_author_' . COOKIEHASH, $comment->comment_author, $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
    setcookie( 'comment_author_email_' . COOKIEHASH, $comment->comment_author_email, $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
    setcookie( 'comment_author_url_' . COOKIEHASH, esc_url( $comment->comment_author_url ), $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );

See this hook used in plugins: