我在我的主题前端使用新的3.5媒体上传程序(基于this 示例)。当您想在\'Select\'
按下按钮:
file_frame.on(\'select\', function() {
// Get all attachments
var attachments = file_frame.state().get(\'selection\').toJSON();
// Do stuff with attachments
});
但如果我想在上传附件后对其进行处理,该怎么办?类似于:
file_frame.on(\'upload\', function() {
// Do stuff with attachments
});
我没有发现任何有用的东西
\'wp-includes/js/media-models.js\'
或
\'wp-includes/js/media-views.js\'
.
我已尝试附加在这些文件中发现的许多事件:
\'add\', \'url\', \'select\', \'ready\', \'escapeHandler\', \'keydown\', \'attach\', \'open\', \'close\', \'escape\', \'recordTab\', \'updateIndex\', \'activate\', \'dismiss\', \'remove\', \'reset\', \'uploading\', \'deactivate\', \'create\', \'render\', \'change:content\', \'scan\', \'prepare\', \'content:render:upload\', \'content:render\', \'content\', \'updateIndex\', \'recordTab\', \'change:uploading\', \'finish\', \'done\', \'upload\', \'uploaded\', \'save\', \'saved\',\'change:compat\', \'compat\'
但所有这些事件都不是在我需要的时候发生的。
谢谢