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.
This is usually done in the WordPress admin area to improve performance and speed. The WordPress post editor uses JavaScript for all buttons on the screen including the add media button. A conflict can stop JavaScript from working which will disable the ‘Add Media’ button.
On your staging site, you need to start by deactivating all your WordPress plugins and then check if it fixed the ‘Add Media’ button. If it does, then this means one of the plugins was causing the issue. You can now activate the plugins one-by-one, and after activating a plugin check the ‘Add Media’ button.
1.Open “options.php” file (File Location: wp\wp-admin\options.php). 2.Add the custom plugin option group in the $whitelist_options array. ? You can download the sample code here. After reading this document you will be able to add the setting of your custom plugin in the WordPress setting menu.
A lot of WordPress themes these days make use of java-script/jQuery to enhance the themes adding things such as image sliders, toggles, accordions, tabs, mobile menus, image hovers…etc. If the these features are not working on your theme or suddenly stopped working its most likely do to some sort of javascript error causing everything to break.
@#$%#, 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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With