Expose featured_media property on post resources in "embed" context
|Reported by:||kadamwhite||Owned by:|
|Component:||REST API||Keywords:||has-patch has-unit-tests commit|
When you create a link relation that allows you to embed a post in a separate response, the "featured_media" property is omitted from that embedded post. This means that the only way to know the featured media item for an embedded post is to either re-request the embedded resource using the "view" or "edit" context, or else to use the _link to wp:featuredmedia (which _is_ present in the embedded resource, despite the omission of the featured_media property) to deduce the ID of the embedded post's associated media item.
It would be more consistent and straightforward for the ID of the featured media for a post to be included in that post object when the post is embedded. To clarify, this is not suggesting the media item is recursively embedded: just that featured_media: 4168 is included in that embedded post object.
Thanks to @westonruter for raising this inconsistency.