Skip to content

Instantly share code, notes, and snippets.

@mostafasoufi
Created November 13, 2016 09:03
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 mostafasoufi/2a69e6d12e246d8b97a1a1a2e2966702 to your computer and use it in GitHub Desktop.
Save mostafasoufi/2a69e6d12e246d8b97a1a1a2e2966702 to your computer and use it in GitHub Desktop.
Disable m4a and m4b type in wordpress upload
<?php
/**
* Modify mime types
* @param array $mime_types Mime types
*/
public function modify_mime_type($mime_types){
// Unset m4a type
unset( $mime_types['mp3|m4a|m4b'] );
// Added mp3 type
$mime_types['mp3'] = 'audio/mp3';
return $mime_types;
}
add_filter( 'upload_mimes', 'modify_mime_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment