-
Notifications
You must be signed in to change notification settings - Fork 651
Link directly to the featured image in a Post's links #1563
Conversation
|
I was thinking we should maybe use a different relation for attached vs featured; maybe @WP-API/amigos Thoughts? |
|
Could we add the post_thumbnail src somewhere? It should be part of the embedded object so we can display a list of posts with thumbnails without going to the /media endpoint separately. For example: |
|
@rmccue Any thoughts on @scottopolis's request?
|
|
@scottopolis Not sure what you're wanting here? The |
|
@rachelbaker If we do make a change around the image URLs, it needs to be in the embedded data, not on the link itself, so shouldn't affect this PR. :) |
|
@rmccue @rachelbaker Yes, we need post thumbnail sizes, not just the source url in the _embed object. This would be just the post thumb, not all attachments. Example use case would be listing posts in a mobile app, so I can display the 150x150px post thumbnail for each post. |
|
Here is the pull request related to my comments #1582 |
Change featured image links
|
Merged #1563 |
|
I think we should have gone with a different relation here, I think having it part of the attachments relation is a bit cumbersome to work with for clients. It looks like that discussed wasn't picked up however. |
Why so? |
|
Looking at the response in http://demo.wp-api.org/wp-json/wp/v2/posts/162?_embed, there's no way to hardcode the path to the featured image link for embedded item, you'd have to do a filter on the If you want to get the data from embedded, there's no way to programmatically know which embedded attachment is the featured image, short of cross referencing with the I don't really understand the rational for the way we have it now, they are different relationships; it seems we are grouping the attachments with the featured image because they are the same resource type, which actually has little bearing on what the relationship is. |
Rather than linking to
wp/v2/media?post_parent=<id>, we should be linking directly to the featured image, with a secondary link out to the former.Fixes #1476.