Created
July 4, 2023 12:26
-
-
Save xardit/64d36fa2832607395d81271f8ba6b051 to your computer and use it in GitHub Desktop.
WP Custom Upload MIME types
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 | |
function my_custom_mime_types( $mimes ) { | |
// New allowed mime types. | |
$mimes['svg'] = 'image/svg+xml'; | |
$mimes['svgz'] = 'image/svg+xml'; | |
$mimes['doc'] = 'application/msword'; | |
// Optional. Remove a mime type. | |
unset( $mimes['exe'] ); | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'my_custom_mime_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or to allow unfiltered uploads for any type, add to functions: