Created
April 25, 2012 02:45
-
-
Save hermpheus/2485763 to your computer and use it in GitHub Desktop.
WordPress: Add Accepted File Type
This file contains hidden or 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['deb'] = 'application/x-deb'; | |
// add as many as you like | |
// removing existing file types | |
unset( $existing_mimes['exe'] ); | |
// add as many as you like | |
// and return the new full result | |
return $existing_mimes; | |
} | |
//MSOffice Mime types: http://filext.com/faq/office_mime_types.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment