uploads – Adding multiple MIME types of the same extension to WordPress?

Question

I am trying to enable DWG MIME types for WordPress file upload, and tried applying this filter. However, because it’s the same array, it won’t work and will only apply the final one below. Wondering if there’s a way to code it to include all?

    $existing_mimes['dwg'] = 'image/vnd.dwg';
    $existing_mimes['dwg'] = 'application/acad';
    $existing_mimes['dwg'] = 'application/autocad';
    $existing_mimes['dwg'] = 'application/autocaddwg';
    $existing_mimes['dwg'] = 'application/dwg';
    $existing_mimes['dwg'] = 'drawing/dwg';
    $existing_mimes['dwg'] = 'image/dwg';

    return $existing_mimes;
}
add_filter('upload_mimes', 'custom_upload_mimes');

0
cchow 4 months 2023-08-21T21:27:31-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse