I am using the wp.media frame uploader in my plugin to upload files. It works perfectly as it should except one problem. When I upload file (using upload button, or drag and drop) it uploads the file and displays its information in sidebar menu, but doesn't display thumbnail of attachment. Its a kind of annoying problem because first its a default behaviour on wp.media and second same implementation is working fine on different plugin. Has anyone come across this problem..
Code I used is:
var alex_doc_uploader = $thisButton.data('file_frame');
if (alex_doc_uploader) {
alex_doc_uploader.open();
return;
}
// Create the media frame.
alex_doc_uploader = wp.media.frames.file_frame = wp.media({
title: "Select Documents",
button: {
text: "Select Documents"
},
library : {
type: accepted_mime_types
},
multiple: true // Set to true to allow multiple files to be selected
});
$thisButton.data('file_frame', alex_doc_uploader);
And when i upload a file,
The result I get is
But what should happen is