我通过添加了几个自定义字段attachment_fields_to_edit
想给他们看only 当特定主题或页面生成器图像选项打开wp.media.iframe
.
当前,无论打开上载程序的按钮是什么,它们都是可见的。例如,post“Add media”将不会使用此选项

所以我有点想找到一个“钩子”,让我知道目前使用上传程序的选项是什么。
我是什么trying to stay away from is文档点击事件
$(document).on("click", \'.some-button-class\', function() {
// .some-button-class is clicked
});
而且会
rather use 如果可能的话,
wp.media.frame.on( \'open\', function(el) {
// some-button-class has opened
});
有没有办法做到这一点?