admin管理员组

文章数量:1122846

I've managed to modify WP so it allows .ai and .psd uploads using the following code:

add_filter('upload_mimes', 'custom_upload_mimes');

function custom_upload_mimes ( $existing_mimes = array() ) {
    $existing_mimes['psd'] = 'image/vnd.adobe.photoshop';
    $existing_mimes['ai'] = 'application/pdf';
    return $existing_mimes;
}

It's mostly working, but there's some weirdness going on in the Media Library. When uploaded, we can see the actual files and the thumbnails/attachments that WP has automatically generated.

The Illustrator file (1) is displaying fine, and you can also see its corresponding thumbnail (2). However, the Photoshop file (3) is missing the image and filename overlay, but the thumbnail is present (4).

What's also odd is that in list view, everything appears to be fine:

I've been scouring through code for hours, but I still can't work it out.

本文标签: PSD File UploadMedia Library not Displaying Thumbnail