Closed visualcookie closed 4 years ago
Hi @visualcookie,
I wouldn't label this as a "bug."
This endpoint returns basically the same response as the core /wp/v2/posts
endpoint which doesn't include the featured image URL either, just the featured image ID.
I haven't tried this but apparently this is one of the ways people use to have the posts
endpoint include the featured image URL from the REST API: https://wordpress.stackexchange.com/a/317331/135534. I believe it should work with WPP's endpoint too so please give it a try and report back the results.
Hej @cabrerahector,
sorry, didn't know where else to categorise this actually. Yeah, that's what I ended up with right now. Don't know if it's best practice but guess will solve it for now at least.
👍
Yeah, I personally don't get why the core endpoint doesn't return the featured image URL either (there's probably a good reason for that but it's unknown to me) but that's how it is. If WordPress ever changes their endpoint so it includes the URL WPP will automatically reflect that change as well.
Anyways, thanks for reporting back. I'm sure this will be useful to others as well. At least as a (temporary) workaround.
Describe the bug When calling
wp-json/wordpress-popular-posts/v1/popular-posts
, the returned posts don't include featured image urls, instead there'sfeatured_media
being returned with theID
of the featured image.To Reproduce Steps to reproduce the behavior:
wp-json/wordpress-popular-posts/v1/popular-posts
Expected behavior JSON should return featured images in different sizes, ideally without forcing the developer to make another API call for EACH post to get the featured image urls.
Environment: