[wp-trac] [WordPress Trac] #63614: pre_get_lastpostdate filter

WordPress Trac noreply at wordpress.org
Tue Jun 24 07:20:44 UTC 2025


#63614: pre_get_lastpostdate filter
--------------------------------------+------------------------------
 Reporter:  gddrt                     |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Query                     |     Version:
 Severity:  minor                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by yashjawale):

 Hi @gddrt welcome to trac 🚀

 @pamprn thanks for the PR!

 But from what I can see, the PR adds test cases for checking the existence
 of the above filter but the implementation for the said filter is
 missing...

 For adding `pre_get_lastpostdate` filter, consider looking at `src/wp-
 includes/post.php` inside `get_lastpostdate()` function

 It calls `_get_last_post_time()` internally & from my understanding, the
 filter could be applied before the queries are called (the OP's aim seems
 to be to modify the `$field` argument value)

 **References:**

 `get_lastpostdate()` https://github.com/WordPress/wordpress-
 develop/blob/trunk/src/wp-includes/post.php#L7492

 `_get_last_post_time()` https://github.com/WordPress/wordpress-
 develop/blob/trunk/src/wp-includes/post.php#L7582

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63614#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list