admin管理员组文章数量:1429088
I'm using Vue.js to consume the Rest API for both posts and a custom post type. I'm using the _embed query on the URL for the endpoint to get sizes for the each featured image.
The issue that I'm encountering is that the "full" size is present on most featured images, but not all. As an experiment, I've also registered a custom image size, which also shows on most posts but not all. I've regenerated media via WP CLI, but no success.
This is troublesome because it causes unpredictability in the Vue app if the size isn't present for a particular post (and, yes, I know I should write the logic to fail gracefully for that, but it feels like this should be a safe bet that each image would have the "out of the box" featured image sizes).
When calling my endpoint into Postman, I can see that _embedded['wp:featuredmedia'][0].media_details.sizes
varies for each item. Only some have "large," some have "medium_large", etc. I've used wp media regenerate
, which returns success, but still doesn't resolve.
So my question is, how do I ensure that all items of this post type have the same featured image sizes available?
本文标签: Not all featured image sizes available in Rest API
版权声明:本文标题:Not all featured image sizes available in Rest API 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745501027a2661032.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论