[wp-trac] [WordPress Trac] #50409: REST API about links should be embeddable.
WordPress Trac
noreply at wordpress.org
Wed Jun 17 13:11:47 UTC 2020
#50409: REST API about links should be embeddable.
-------------------------+-----------------------------
Reporter: herregroen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: normal | Keywords:
Focuses: rest-api |
-------------------------+-----------------------------
Currently the `about` links in the REST API aren't embeddable using the
`?_embed=true` parameter.
Most likely cause I can think of is that, by default, this route (
`wp/v2/types/$post_type` ) doesn't contain much information and as such
there's likely no need for it.
However plugins can add their own custom fields to post types that would
be added to this route. Currently if one wishes to fetch that data an
additional request would have to be made as it's not possible to embed the
data in a previous request.
Making the about link embeddable would give the option to consumers of the
REST API to also easily fetch custom fields on post types without
requiring an additional request.
This change would be extremely minimal as it'd only require adding
`'embeddable' => true`, on line 1864 in `wp-includes/rest-api/endpoints
/class-wp-rest-posts-controller.php`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50409>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list