Created
November 3, 2018 20:38
-
-
Save nathaningram/2b53cb2cd8939e63501148a349802038 to your computer and use it in GitHub Desktop.
Add SVGs to WordPress Allowed File Types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add SVG Format to Allowed WordPress File Types | |
function ni_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', 'ni_add_file_types_to_uploads'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment