Created
January 22, 2024 15:02
-
-
Save elias1435/99fbfd4b6b2e3a676fbb0b68aa7180d7 to your computer and use it in GitHub Desktop.
Add SVG to allowed file uploads to WordPress
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 to allowed file uploads | |
function add_file_types_to_uploads($file_types){ | |
$new_filetypes = array(); | |
$new_filetypes['svg'] = 'image/svg'; | |
$file_types = array_merge($file_types, $new_filetypes ); | |
return $file_types; | |
} | |
add_action('upload_mimes', 'add_file_types_to_uploads'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment