[wp-trac] [WordPress Trac] #49985: REST API: Using _embed and _fields query parameters in the same query
WordPress Trac
noreply at wordpress.org
Thu Apr 23 16:06:43 UTC 2020
#49985: REST API: Using _embed and _fields query parameters in the same query
-----------------------------+-----------------------------
Reporter: anouarbenothman | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 5.4
Severity: normal | Keywords:
Focuses: rest-api |
-----------------------------+-----------------------------
When performing a REST API request and adding the _embed and _fields query
parameters. the API attempts to skip unneeded fields but does not embed
resources that are linked with embeddable set to true.
In some cases we may need _embed and _fields in the same query.
I am requesting the feature to be added to allow the filtering of
resources and embedding them (the embeddable ones) at the same time when
specifying the _embed and _fields.
Example:
http://<site>/wp-json/wp/v2/posts?_fields=title,author&_embed=author
If implemented, the above request should only return title and author, and
embed the author.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49985>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list