admin管理员组文章数量:1318564
I addes this code to allow SVG Uploads to the Media Library of wordpress:
function upload_svg ( $svg_mime ){
$svg_mime['svg'] = 'image/svg+xml';
return $svg_mime;
}
add_filter( 'upload_mimes', 'upload_svg' );
define('ALLOW_UNFILTERED_UPLOADS', true);
Than I added some SVGs to the Media Library. Using them works perfectly fine. The only Issue I have is that they will not be displayed in the Media Library. On other Pages in the Backend they display fine.
Is there anything I can do to display them in the Media Tab aswell? I couln't find anything online on how to fix this issue.
I addes this code to allow SVG Uploads to the Media Library of wordpress:
function upload_svg ( $svg_mime ){
$svg_mime['svg'] = 'image/svg+xml';
return $svg_mime;
}
add_filter( 'upload_mimes', 'upload_svg' );
define('ALLOW_UNFILTERED_UPLOADS', true);
Than I added some SVGs to the Media Library. Using them works perfectly fine. The only Issue I have is that they will not be displayed in the Media Library. On other Pages in the Backend they display fine.
Is there anything I can do to display them in the Media Tab aswell? I couln't find anything online on how to fix this issue.
Share Improve this question asked Oct 15, 2020 at 16:12 NiqqlNiqql 534 bronze badges 1- 1 The solution is lengthy. Here's an external link: sitepoint/wordpress-svg – cjbj Commented Oct 19, 2020 at 10:18
2 Answers
Reset to default 0This is the solution to allow SVG upload and preview to Media area of WordPress: https://gist.github/benfrain/9422862
Try to use this plugin: https://wordpress/plugins/wp-extra-file-types/. I use it and .svg files seems fine in media lib.
本文标签: uploadsSVG not displaying in Media Tab in Backend
版权声明:本文标题:uploads - SVG not displaying in Media Tab in Backend 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742049668a2417999.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论