最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

List of available events for wp.media

programmeradmin0浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 10

If 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.

发布评论

评论列表(0)

  1. 暂无评论