Last active
December 1, 2021 11:06
-
-
Save rotisoft/180cdcaee0876f4624dbbd50ca3b6fab 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
/** | |
* Add that code to your theme functions.php file. Choose or modify which file/mime type need and delete the others. | |
* Replace the file type. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types | |
* Gist by Tamas Rottenbacher | |
* Source: https://wpsmackdown.com/add-remove-filetypes-wordpress-media-library/ | |
*/ | |
function disable_mime_types($mime_types){ | |
unset($mime_types['bmp']); // Disable .bmp file upload | |
unset($mime_types['tiff']); // Disable .tiff file upload | |
return $mime_types; | |
} | |
add_filter('upload_mimes', 'disable_mime_types', 1, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment