Before I come to this trick, I’ve been using the SVG Support for quite a while. But for now, only a bunch of code, I can have my WordPress website supports the SVG file type upload like a charm.
function allow_svg_upload($mimes = array()){
$mimes['svg'] = 'image/svg+xml';
$mimes['svgz'] = 'image/svg+xml';
$mimes['json'] = 'application/json';
return $mimes;
}
add_filter('upload_mimes', 'allow_svg_upload');