A small snippet of code will do the trick, which will be especially important with the increase use of .svg files, such as the WordPress SVG logo!
For example, right now, most of you will experience this issue if you try to upload a .svg file:
If you’d like to allow uploading all you have to do is add this line of code in your functions.php
file:
[code]
add_filter(‘upload_mimes’, ‘my_upload_mimes’);
function my_upload_mimes($mimes = array()) {
$mimes[‘svg’] = ‘image/svg+xml’;
return $mimes;
}
[/code]
Not too bad, right?
Then it works. Voila.
1 Comment