Is there a list of available events for wp.media object? By doing some googling, I managed to find following events: for wp.media.view.Modal.prototype: open, ready - they are triggered, when user opens the Modal window.
The reason why I need this list is that I want to insert a select box on the right side, when user clicks an item on the Insert Media window. This select has to be formatted with Chosen library, but since the Backbone view is loaded only on user interaction, I need to know, on which event to initialize Chosen.
Please add other events in your answers.
Is there a list of available events for wp.media object? By doing some googling, I managed to find following events: for wp.media.view.Modal.prototype: open, ready - they are triggered, when user opens the Modal window.
The reason why I need this list is that I want to insert a select box on the right side, when user clicks an item on the Insert Media window. This select has to be formatted with Chosen library, but since the Backbone view is loaded only on user interaction, I need to know, on which event to initialize Chosen.
Please add other events in your answers.
Share Improve this question asked Sep 28, 2016 at 9:41 Kārlis BaumanisKārlis Baumanis 2102 silver badges6 bronze badges2 Answers
Reset to default 10If you're still looking for this kind of answer, one way of figuring out what is firing is by entering this in your browser console and using the media modal:
wp.media.frame.on('all', function(e) { console.log(e); });
You can install the plugin WordPress Media Javascript Guide. It explains with screenshots and examples the must use method of the wp.media object.