Add SVG suport to the WordPress media library

To enable SVG support in the WordPress media library simply add the following code to the bottom of your WordPress theme’s functions.php file. You will now be able to upload and use SVG images, just like jpeg and png images. 

function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
add_action('upload_mimes', 'add_file_types_to_uploads');