Make WordPress Core

Changeset 11223


Ignore:
Timestamp:
05/06/2009 08:58:46 PM (16 years ago)
Author:
westi
Message:

Allow a plugin to vary the comment cookie lifetime (or even remove the cookies altogether). Fixes #4996.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r10684 r11223  
    7777$comment = get_comment($comment_id);
    7878if ( !$user->ID ) {
    79     setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
    80     setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
    81     setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
     79    $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);
     80    setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
     81    setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
     82    setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
    8283}
    8384
Note: See TracChangeset for help on using the changeset viewer.