[wp-trac] [WordPress Trac] #44748: Ability to register custom embeds to built-in endpoints
WordPress Trac
noreply at wordpress.org
Tue Aug 7 10:14:51 UTC 2018
#44748: Ability to register custom embeds to built-in endpoints
-----------------------------+-----------------------------
Reporter: k1sul1 | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
-----------------------------+-----------------------------
Couldn't find any tickets related to this, probably because this page is
broken (?): https://core.trac.wordpress.org/component/REST+API
There are situations where we "link" to other posts using custom fields,
and would like to include said posts when querying for the post that
includes said links.
Here's what I already get from the standard /wp/v2/posts/123 endpoint.
{{{
"linkedProductCards": [
856628
]
}}}
I'd like to be able to easily fetch and embed the posts under
linkedProductCards, with just one network request.
{{{
"_embedded": {
"linkedProductCards": [
{ "id": 856642, "date": "2018-08-06T14:32:06", .. },
]
}
}}}
And I'd like to be able to have control over whether the embedded post
also embeds, as making a separate network request to get the featured
image object kinda defeats the purpose of this feature.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44748>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list