[wp-trac] [WordPress Trac] #39494: Make it possible for taxonomy query to include children in REST API
WordPress Trac
noreply at wordpress.org
Thu Mar 15 09:49:45 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
-----------------------------+-----------------------------
Comment (by birgire):
@jason_the_adams I uploaded the [attachment:39494.3.diff] patch where I
played with a new {{{categories_object}}} query parameter, just to
understand better how it works and to preserve the previous
{{{categories}}} query parameter setup. Also I'm not sure it's supported
to use a mixed schema (array+object) for query parameters in
{{{WP_REST_Posts_Controller::get_collection_params()}}}. It supports
{{{term_ids}}}, {{{term_slugs}}} and {{{include_children}}}. The
{{{term_slugs}}} takes precedence over {{{term_ids}}}.
[attachment:39494.3.diff] has the tests:
- {{{test_get_items_categories_by_term_ids_and_include_children_true()}}}.
-
{{{test_get_items_categories_by_term_ids_and_include_children_false()}}}.
-
{{{test_get_items_categories_by_term_slugs_and_include_children_true()}}}.
-
{{{test_get_items_categories_by_term_slugs_and_include_children_false()}}}.
The two tests methods in [attachment:39494.2.diff] ran successfully in
isolation, but not for e.g. the restapi group. But these four tests
methods above seems to run successfully for that group.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39494#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list