[wp-trac] [WordPress Trac] #39494: Make it possible for taxonomy query to include children in REST API
WordPress Trac
noreply at wordpress.org
Thu Jan 5 23:49:36 UTC 2017
#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: 4.8
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: rest-api
------------------------------------------+-----------------------
Changes (by jnylen0):
* keywords: => needs-patch needs-unit-tests
* version: => 4.7
* milestone: Awaiting Review => 4.8
Comment:
Thanks for moving this over to Trac (previously https://github.com/WP-API
/WP-API/issues/2909).
It looks like you're referring to this code block:
[https://core.trac.wordpress.org/browser/tags/4.7/src/wp-includes/rest-
api/endpoints/class-wp-rest-posts-controller.php#L259 posts endpoint
`tax_query`]
I think the general approach you've proposed of accepting a string or an
object is a good one - it leaves the way open for further enhancements
such as querying terms by slug. Needs a few things, though:
- Patch file with [https://make.wordpress.org/core/handbook/best-practices
/coding-standards/php/ correct spacing] and ternary statements split out
into `if` blocks for clarity
- Unit tests for old and new behavior
- Updates to arguments and schema for autodiscovery responses (something
similar to `content` should work well here, because it also accepts a
string or an object)
Also note that for the purposes of the schema/arguments, this would be
`type => 'object'` rather than `type => 'array'`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39494#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list