Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
WordPress snippet: add uploadable file types
* Add uploadable mime types / file extensions
function dc_add_uploadables($arr = array()) {
$new = array(
// Add file extension => mime type mapping here
'keynote|key' => 'application/',
'numbers' => 'application/',
'pages' => 'application/'
$arr = array_merge($arr, $new);
return $arr;
if ( function_exists( 'wp_get_mime_types' ) ) {
// @since WordPress 3.5.0
add_filter('mime_types', 'dc_add_uploadables');
} else {
add_filter('upload_mimes', 'dc_add_uploadables');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.