Created
August 19, 2014 15:54
-
-
Save bi0xid/e6118ef43f3290f4ce89 to your computer and use it in GitHub Desktop.
Add mimetype
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
<?php | |
add_filter('upload_mimes', 'custom_upload_mimes'); | |
function custom_upload_mimes ( $existing_mimes = array() ) { | |
// add your extension to the array | |
$existing_mimes['patch'] = 'text/plain'; | |
$existing_mimes['diff'] = 'text/plain'; | |
$existing_mimes['po'] = 'text/plain'; | |
$existing_mimes['conf'] = 'text/plain'; | |
$existing_mimes['mo'] = 'text/plain'; | |
$existing_mimes['rtf'] = 'text/rtf'; | |
$existing_mimes['rtfd'] = 'text/rtfd'; | |
$existing_mimes['xml'] = 'text/xml'; | |
$existing_mimes['ai'] = 'application/illustrator'; | |
$existing_mimes['zip'] = 'application/zip'; | |
$existing_mimes['psd'] = 'image/psd'; | |
$existing_mimes['fh11'] = 'application/x-freehand'; | |
$existing_mimes['xls'] = 'application/vnd.ms-excel'; | |
$existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; | |
$existing_mimes['pages'] = 'application/x-iwork-pages-sffpages'; | |
return $existing_mimes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment