name
for each fields needs to be unique aswell. Now it works like it should 🙂
Here’s some debug information from the ajax call
Just wanna add that I had trouble getting this to work aswell. But I’m using Sage theme from Roots, and you need to hook into the filters like this:
add_filter('upload_dir', __NAMESPACE__ . '\\my_upload_directory');
add_filter('acf/upload_prefilter/name=preview_video', __NAMESPACE__ . '\\my_acf_upload_prefilter');
Otherwise it won’t be able to locate the filters.
Ah. Yes I plan on running a little script called color thief (https://github.com/lokesh/color-thief/) I will save the values generated from the script and use it for styling.
Actually, wp.media.gallery exist, but can’t see any attachments to it, hm. wp.media.gallery.attachments exist but only links to a function in media-edtior.js:
* @param {wp.shortcode} shortcode An instance of wp.shortcode().
* @returns {wp.media.model.Attachments} A Backbone.Collection containing
* the media items belonging to a collection.
* The query[ this.tag ] property is a Backbone.Model
* containing the ‘props’ for the collection.