[wp-trac] [WordPress Trac] #52732: 'get_posts' has been waiting for so long to have a hook

WordPress Trac noreply at wordpress.org
Tue Feb 13 15:33:33 UTC 2024


#52732: 'get_posts' has been waiting for so long to have a hook
-------------------------------+------------------------------
 Reporter:  ttodua             |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by ttodua):

 Replying to [comment:1 SergeyBiryukov]:
 > Hi there, thanks for the patch!
 >
 > Could you provide a use case that would be easier to achieve with this
 new filter than with the existing WP_Query filters, e.g. `pre_get_posts`,
 `posts_results`, `the_posts`, and others?

 sorry for late reply.
 yes, the use case is not about building query ourselves, but the intention
 of this PR is to be able to hook into themes/plugins which we don't
 control, so many of them directly use `get_posts` method in their
 implementations and we hadn't have any other way to hook into them.

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


More information about the wp-trac mailing list