Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add custom mime types to Wordpress
//The following goes in a themes functions file or a custom hooks plugin
function custom_upload_mimes ( $existing_mimes ) {
$existing_mimes['epub'] = 'application/epub+zip';
$existing_mimes['mobi'] = 'application/x-mobipocket-ebook';
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
You can’t perform that action at this time.