[wp-trac] [WordPress Trac] #39805: Expose featured_media property on post resources in "embed" context
WordPress Trac
noreply at wordpress.org
Tue Feb 7 16:50:46 UTC 2017
#39805: Expose featured_media property on post resources in "embed" context
----------------------------------------+------------------------------
Reporter: kadamwhite | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+------------------------------
Comment (by westonruter):
The situation in particular that I had this problem is I created a
`related` field that links one post to another. This `related` field is an
integer post ID and its link is added as embeddable. When I made a request
with `_embed` for the items having related posts, I was unable to obtain
the `featured_media` via `getFeaturedMedia()` in the Backbone client.
In other words, if the `post` is hydrated with data that has `_embedded`:
{{{#!js
post.getRelatedPost().done( function( relatedPost ){
relatedPost.getFeaturedMedia(); // => Will always fail.
} );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39805#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list