Advertisement
brooklyndesignstudio

Add DOCX Mime Type

Mar 5th, 2020
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
  2. function my_myme_types( $mime_types ) {
  3.   $mime_types['doc'] = 'application/msword';     // Adding .doc extension
  4.   $mime_types['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; // Adding .docx extension
  5.  
  6.   unset( $mime_types['xls'] );  // Remove .xls extension
  7.   unset( $mime_types['xlsx'] ); // Remove .xlsx extension
  8.  
  9.   return $mime_types;
  10. }
  11.  
  12. // Add WP Add Mime Types plugin to work
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement