upload_mimes filter has no effect

I would use:

add_filter( 'upload_mimes', 'theme_restrict_mime_types' );
function theme_restrict_mime_types( $mime_types )
{
    $mime_types = array(
        'wif' => 'text/plain',
        'doc|docx' => 'application/msword',
        'jpg|jpeg' => 'image/jpeg',
        'gif' => 'image/gif',
        'png' => 'image/png'
    );
    return $mime_types;
}

In this example I list all types that I allow (with WIF included). So you would need to add whats missing for your liking.

This works on my WP 3.3.1 install.

Leave a Comment