[wp-trac] [WordPress Trac] #38629: REST API: Allowed public or private WP_Query vars are lost in `prepare_items_query()`
WordPress Trac
noreply at wordpress.org
Mon Nov 7 06:52:54 UTC 2016
#38629: REST API: Allowed public or private WP_Query vars are lost in
`prepare_items_query()`
--------------------------+-----------------------
Reporter: rachelbaker | Owner: rmccue
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.7
Component: REST API | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+-----------------------
Comment (by rmccue):
Added a patch that removes `get_allowed_query_vars()`. Per discussion,
this is really only needed when we were accepting anything. A plugin that
re-implements `filter` (removed in #38378) would need to add these filters
back for `filter` sub-parameters.
This patch adds a new filter: `rest_{type}_collection_params`, allowing
implementation per [comment:13 Joe's comment above]. I've also retained
the `rest_query_var-{var}` filter, although I'm not sure whether we need
that, as `rest_{type}_query` can be used on the array instead.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38629#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list