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

2

7

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.

Trigonous answered 1/4, 2018 at 2:4 Comment(0)
T
12

@#$%#, 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!

Trigonous answered 1/4, 2018 at 2:16 Comment(0)
P
6

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.

Pilot answered 21/10, 2019 at 14:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.