Last active
August 29, 2015 14:20
-
-
Save sdelamo/f2bf87eee80af165974a to your computer and use it in GitHub Desktop.
Add Forbidden Mime Types to Wordpress
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 | |
function custom_upload_mimes ( $existing_mimes = array() ) { | |
// add your extension to the array | |
$existing_mimes['gpx'] = 'application/application/gpx+xml'; | |
$existing_mimes['kml'] = 'application/vnd.google-earth.kml+xml'; | |
// or: $existing_mimes['ppt|pot|pps'] = 'application/vnd.ms-powerpoint'; | |
// to add multiple extensions for the same mime type | |
// 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; | |
} | |
add_filter('upload_mimes', 'custom_upload_mimes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment