[wp-trac] [WordPress Trac] #39494: Make it possible for taxonomy query to include children in REST API

WordPress Trac noreply at wordpress.org
Wed Mar 14 10:59:04 UTC 2018


#39494: Make it possible for taxonomy query to include children in REST API
-----------------------------+-----------------------------
 Reporter:  jason_the_adams  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  REST API         |     Version:  4.7
 Severity:  normal           |  Resolution:
 Keywords:  needs-testing    |     Focuses:  rest-api
-----------------------------+-----------------------------
Changes (by birgire):

 * keywords:  needs-unit-tests needs-testing => needs-testing


Comment:

 Replying to [comment:7 jason_the_adams]:
 > Presently the unit test isn't working, but I'm baffled as to why. Also,
 it's breaking another unit test, but I'm also unsure as to why that one is
 being affected (the test mostly works, but fails where it expects an
 error).

 Hi @jason_the_adams, thanks for the patch. I adjusted your patch in
 [attachment:39494.patch] with the draft in [attachment:39494.2.diff] that
 includes two tests methods that run successfully:
 -
 {{{test_get_items_categories_with_updated_taxonomy_schema_and_include_children_true()}}}
 -
 {{{test_get_items_categories_with_updated_taxonomy_schema_and_include_children_false()}}}

 But I'm still hesitated about updating previous schema, I wonder if new
 {{{$base}}} parameters would be needed instead, to introduce a new schema?
 I didn't change e.g. the schema in the
 {{{WP_REST_Posts_Controller::get_collection_params()}}}.

 I also wonder about alternatives to {{{ids}}} like {{{terms}}},
 {{{term_id}}} or {{{term_ids}}}? And how e.g. a possible future term
 slug(s) filtering support would play with this and it's naming convention?

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


More information about the wp-trac mailing list