How to enable sorting in custom media uploader in plugin
In my plugin I need a media uploader exactly like the one you see when you select a post's featured image.
I managed to do almost everything with this code:
media_uploader = window.wp.media({
frame: 'select',
title: 'Carica le foto',
multiple: true,
library: {
type: 'image',
search: null,
uploadedTo: postID
},
button: {
text: 'Imposta come principale'
}
});
The problem is that I can't sort the uploaded images. If I click and drag the images in the media uploader, the images are stuck.
I can see that in my uploader there is the class ui-sortable-disabled
wich is absent in the default one (see images below). I searched in the documentation but I didn't find anything useful about this topic.
Topic media-modal media-library uploads plugin-development sort Wordpress
Category Web