Created
June 6, 2018 22:22
-
-
Save johnalarcon/fe1ff36b8220616523adc9ce560782da to your computer and use it in GitHub Desktop.
A simple snip for removing MS document support from the WordPress Media Uploader. Created after a brief discussion during our 6/5/18 meetup.
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
/** | |
* Remove support for files of type doc, docx, docm, dotx, and dotm from the | |
* WordPress Media Uploader. Place this code into your theme's functions.php file. | |
*/ | |
add_filter('upload_mimes', 'jalarcon_remove_filetypes', 1, 1); | |
function jalarcon_remove_filetypes($filetypes) { | |
unset($filetypes['doc']); | |
unset($filetypes['docx']); | |
unset($filetypes['docm']); | |
unset($filetypes['dotx']); | |
unset($filetypes['dotm']); | |
return $filetypes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment