[wp-trac] [WordPress Trac] #41159: REST API: Add a way to determine if a request is an embedded "sub-request"
WordPress Trac
noreply at wordpress.org
Sun Jun 25 12:27:06 UTC 2017
#41159: REST API: Add a way to determine if a request is an embedded "sub-request"
-------------------------+------------------------------------------
Reporter: jnylen0 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version: 4.4
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: rest-api |
-------------------------+------------------------------------------
Currently it's difficult to determine whether a request is the "root"
request or a "child" embedded request due to `?_embed` using multiple
`WP_REST_Request` objects. #38964 will help a bit, but we should also add
a way to directly track whether a request is part of an embed tree.
Something like this:
- `$request->is_embed`: boolean property indicating whether the request is
a "child" embedded request
- `$request->embed_parent`: `WP_REST_Request` object pointing to parent
request, or `null` if none
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41159>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list