How to set additional parameter in wp.media?
I’ve been searching for this answer too and found it using this answer. You just need to add a property to the library object: var wpMedia = wp.media.frames.file_frame = wp.media({ ‘library’: { type: ‘image’, custom_var: ‘webhead’ }, ‘multiple’: true }); Then in PHP you can see the custom variable in the ajax_query_attachments_args hook like so: … Read more