[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:36:39 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: Future Release
Component: REST API | Version: 5.4
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: rest-api
------------------------------------------+-----------------------------
Changes (by TimothyBlynJacobs):
* keywords: => needs-patch needs-unit-tests
* milestone: Awaiting Review => Future Release
Comment:
Yeah this is a bit of an annoying issue. The problem is that
`rest_filter_response_fields` will remove the `_links` field before link
embedding is processed. So the server doesn't know what resources to
embed.
We could perhaps fix this by not excluding `_links` in
`rest_filter_response_fields` if `_embed` is set.
Another step would be to reduce the `_links` to only contain entries
specified by `_embed` if `_links` is not included in `_fields` at all.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49985#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list