Vel
Vel

Reputation: 191

wp.media multiple:true setting isnt working in custom plugin

I'm using the wordpress media library in my plugin...

var images = wp.media({
            title: 'Upload Images',
            library: {type: 'image'},
            multiple: true
        }).open().on('select', function(e){...});

... but multiple:true is not working. I found a post the other day where someone listed an option other than 'true' that made the selection of multiple images work in my plugin. I didn't think I'd need it then but now I do and after days of searching I still can not find this post again.

If anyone could please point me to this post or tell me what value to use to make this work with the newest version of wordpress I would greatly appreciate it.

I know the codex and a ton of posts say the value should be true but this doesnt work and I know something else will because I did it the other day in testing.

Upvotes: 7

Views: 1230

Answers (2)

Tristan CHARBONNIER
Tristan CHARBONNIER

Reputation: 1231

For the sake of completness:

multiple: true works and allows the user to select multiple images BUT the user has to press CTRL key while selecting files if he wants to select more than one.

multiple: 'add' works and allows the user to select multiple images WITHOUT requiring the user to press the CTRL key.

Upvotes: 6

Vel
Vel

Reputation: 191

@#$%#, remembered it as soon as I left this post!

It's multiple: 'add' if anyone needs to know.

And if anyone finds the post give them credit!

Upvotes: 12

Related Questions