[wp-trac] [WordPress Trac] #39708: Provide suppress_actions argument on WP_Query::get_posts or apply suppress_filters to pre_get_posts

WordPress Trac noreply at wordpress.org
Tue Jul 3 16:12:19 UTC 2018


#39708: Provide suppress_actions argument on WP_Query::get_posts or apply
suppress_filters to pre_get_posts
-------------------------+------------------------------
 Reporter:  aubreypwd    |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  4.7.1
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by jason_the_adams):

 As much as I wish there was better consistency in queries, I believe this
 would be an issue of backwards compatibility. The object is passed by
 reference to the `pre_get_posts` filter, meaning even though
 plugins/themes couldn't affect the rest of the hooks, they certainly are
 able to modify the query by changing the WP_Query instance at this point.

 So if that hook were to be included in the hook suppression, existing code
 which changes the query without worrying about the rest of the hooks are
 available (or checking `$wp_query->get('supress_filters')`) would
 immediately break.

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


More information about the wp-trac mailing list