[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 03:13:43 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 |
-------------------------------------------------+-------------------------
Comment (by TimothyBlynJacobs):
This is looking really great @dlh. Would you mind converting this to a PR?
I like using `terms`. Either way though we would probably still need a
more advanced schema if we do support querying by different fields. Since
we'd want to make sure `terms` is an array of ints when `field` is `id`. I
think using separate properties implies that you could pass both ids and
slugs in the same request. I don't think we could properly support that.
I think we should pull out the whole `tax_query` building into a separate
method at this point. We might also want to put the `oneOf` in a variable
in `get_item_schema` and reuse that to ensure they stay in sync. Lastly,
let's make sure to give a `title` to each `oneOf` case, as well as
descriptions for the cases and properties.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39494#comment:33>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list