[wp-trac] [WordPress Trac] #39696: REST API: Filter which links get embedded when passing the ?_embed query parameter
WordPress Trac
noreply at wordpress.org
Wed Jan 25 23:07:00 UTC 2017
#39696: REST API: Filter which links get embedded when passing the ?_embed query
parameter
--------------------------+-----------------------------
Reporter: rheinardkorf | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.7.1
Severity: normal | Keywords:
Focuses: rest-api |
--------------------------+-----------------------------
When performing a REST API request and adding the '''?_embed''' query
parameter the API attempts to embed all resources that is linked with
'''embeddable''' set to true.
In some cases we may need to only embed some resources, not all embeddable
resources. I am requesting that the feature be added to allow the
filtering of a resources when specifying the _embed parameter.
Example:
{{{
http://<site>/wp-json/wp/v2/posts/48?_embed=author,wp:term
}}}
If implemented, the above request should only embed the Author and the
Terms. (note that in this example : will be encoded to %3A)
'''Starting point:'''
This can be implemented on the WP_REST_Server class and is likely to
effect the following methods:
response_to_data, embed_links
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39696>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list