admin管理员组文章数量:1278910
The add_image_size function is used to add image sizes in addition to the default thumbnail, medium, large, & full which are generated in WordPress by default.
Is there any way to only add those image sizes for specific uploads? Or are we limited to generating all possible image sizes for every upload?
The add_image_size function is used to add image sizes in addition to the default thumbnail, medium, large, & full which are generated in WordPress by default.
Is there any way to only add those image sizes for specific uploads? Or are we limited to generating all possible image sizes for every upload?
Share Improve this question asked Oct 14, 2021 at 18:46 admcfajnadmcfajn 1,3262 gold badges13 silver badges30 bronze badges1 Answer
Reset to default 1Take a look at the intermediate_image_sizes_advanced filter. This filter receives the attachment ID in question, so with that you should be able to work out whether or not you want the intermediate sizes, and return an empty array if not.
本文标签: plugin developmentConditional Generation of Image Sizes using addimagesize
版权声明:本文标题:plugin development - Conditional Generation of Image Sizes using add_image_size 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741269782a2369062.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论