[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
Wed Nov 2 21:32:43 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:  needs-patch   |     Focuses:
--------------------------+-----------------------
Changes (by rachelbaker):

 * owner:   => rmccue
 * status:  new => assigned


Comment:

 @rmccue There seems to be some disagreement among @joehoyle, @kadamwhite,
 and myself regarding if public WP Query vars were expected to be
 supported.

 Right now `get_allowed_query_vars()` is broken.  It does nothing for any
 parameter that isn't defined in the collection schema AND in the
 `$parameter_mappings` array in `get_items()`.

 @joehoyle and I tossed around some possible alternate solutions such
 filtering `get collection_params()` for each endpoint's schema to be
 filterable.  I know this is a "feature" that the API has had from the
 beginning, and that losing this functionality with the removal of the
 `filter` param may not have been something you were aware of.

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


More information about the wp-trac mailing list