[wp-trac] [WordPress Trac] #63690: Use `comment_cookie_lifetime` filter when removing comment cookies for consistency

WordPress Trac noreply at wordpress.org
Fri Jul 11 07:11:46 UTC 2025


#63690: Use `comment_cookie_lifetime` filter when removing comment cookies for
consistency
-------------------------+-------------------------------------------------
 Reporter:               |      Owner:  (none)
  akshaykungiri          |
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Comments     |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch needs-testing good-first-
  Focuses:               |  bug
-------------------------+-------------------------------------------------
 {{{

 }}}
 Currently, the `wp_set_comment_cookies()` function uses the
 `comment_cookie_lifetime` filter only when setting cookies, but not when
 removing them.

 This leads to a minor inconsistency: developers filtering
 `comment_cookie_lifetime` may expect the same value to apply in both
 cases, particularly when setting a past timestamp to delete cookies.

 ### Proposed Enhancement

 This patch ensures consistency by applying the same
 `comment_cookie_lifetime` filter when calculating the `$past` value for
 cookie removal:

 `php`
 $past = time() - apply_filters( 'comment_cookie_lifetime', YEAR_IN_SECONDS
 );

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63690>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list