Allow SVG uploads in WordPress

By Default WordPress denies the upload of SVG files via the media uploader. This can be fixed by adding the following code into the functions.php file.


function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');