[wp-trac] [WordPress Trac] #41678: Make sure all field returns use filters in WP Query
WordPress Trac
noreply at wordpress.org
Sun Aug 20 14:39:53 UTC 2017
#41678: Make sure all field returns use filters in WP Query
-------------------------------------------------+-------------------------
Reporter: spacedmonkey | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Query | Review
Severity: normal | Version: 1.5
Keywords: has-patch needs-unit-tests dev- | Resolution:
feedback | Focuses:
| performance
-------------------------------------------------+-------------------------
Changes (by spacedmonkey):
* keywords: => has-patch needs-unit-tests dev-feedback
* version: => 1.5
Comment:
In [https://core.trac.wordpress.org/attachment/ticket/41678/41678.diff
41678.diff] code has be refactored to run through more filters.
Key features
- There are now 2 only types of query, id and all fields. id=>parents are
now treated the same as all fields and the return is changed at the latest
possible moment.
- New filter added named `posts_results_ids` for query of 'ids', to get a
filter of result of query. Useful for caching plugins. This new filter is
added, as `posts_results` expects an array of `WP_Post` objects.
- 'id=>parents' now runs through the following filters `the_posts`,
`posts_results`, `posts_request_ids` and `split_the_query`.
This patch will be extremely useful for a plugin like elasticpress.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41678#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list