Skip to content

Instantly share code, notes, and snippets.

@johnalarcon
Created June 6, 2018 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnalarcon/fe1ff36b8220616523adc9ce560782da to your computer and use it in GitHub Desktop.
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.
/**
* 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