[wp-trac] [WordPress Trac] #54371: Add posts_results-like filters to WP_Query when return fields are ids or id=>parent

WordPress Trac noreply at wordpress.org
Wed Nov 3 23:47:38 UTC 2021


#54371: Add posts_results-like filters to WP_Query when return fields are ids or
id=>parent
-------------------------+-----------------------------
 Reporter:  sc0ttkclark  |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Query        |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The WP_Query class offers no ability to hook into after queries that
 return posts as IDs or ID => Parent format.

 The changes proposed here introduce new filters that offer similar
 capabilities to the pre-existing posts_results filter which runs in other
 cases.

 This is similar to #41700 and #41678 but the approach is to address this
 by simply adding two new filters.

 To review those other tickets and how they differ to this one:

 * #41700 requests hooking into after all of the logic runs but before the
 return is made.
 * #41678 requests refactoring the queries so that the individual ids /
 id=>parent queries can take advantage of all of the other hooks further
 down the line.
 * The suggestion in this ticket is to hook the same exact way that the
 existing posts_results filter does without refactoring or introducing new
 filter naming.

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


More information about the wp-trac mailing list