SVG not displaying in Media Tab in Backend

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.

Topic svg thumbnails uploads media Wordpress

Category Web


This is the solution to allow SVG upload and preview to Media area of WordPress: https://gist.github.com/benfrain/9422862


Try to use this plugin: https://wordpress.org/plugins/wp-extra-file-types/. I use it and .svg files seems fine in media lib.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.