Created
January 2, 2018 11:08
-
-
Save petersplugins/e45474b26afdd53132d5157cd13e4329 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
// This code snippet adds additional file types allowed to upload | |
// Add a custom function to add needed mime types | |
add_filter( 'upload_mimes', 'add_mime_types' ); | |
function add_mime_types( $mime_types ) { | |
// add file extensions .svg, .webp, .ai, .eps, .ep, .xml | |
// more file extensions can be added just the same | |
// for each file type the MIME type is needed | |
return array_merge( $mime_types, array( | |
'svg' => 'image/svg+xml', | |
'webp' => 'image/webp', | |
'ai|eps|ps' => 'application/postscript', | |
'xml' => 'text/xml' | |
) ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment