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

WordPress Trac noreply at wordpress.org
Tue Jan 26 02:58:19 UTC 2021


#39494: Make it possible for taxonomy query to include children in REST API
-------------------------------------------------+-------------------------
 Reporter:  jason_the_adams                      |       Owner:  dlh
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.7
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing has-patch has-unit-    |     Focuses:  rest-api
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by dlh):

 * keywords:  needs-testing needs-refresh needs-unit-tests => needs-testing
     has-patch has-unit-tests


Comment:

 [attachment:"39494.4.diff"] is a first pass at adding object schema
 support for both the `$taxonomy` and `"{$taxonomy}_exclude"` parameters
 via the new `oneOf` keyword.

 There was some discussion above about the naming of the object property
 for term IDs. The patch goes with `terms` for parity with the
 `WP_Tax_Query` parameter and for a potentially easier addition of a
 sibling `field` property later for querying by `slug` or `name`. But I'm
 open to switching it to `ids` or similar if the plan would be to use
 separate `oneOf` schema for slug or name queries.

 Given this uncertainty about how slug or name queries might be supported
 later, the object schema declares `'additionalProperties' => false` to
 "reserve" the space for future core properties.

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


More information about the wp-trac mailing list