我正在为自定义图库支持开发一个mce插件。我可以像往常一样创建多个画廊,但编辑/铅笔图标(以可视模式显示在画廊上)不能区分多个画廊。事实上,我甚至不确定如何获得发起活动的画廊。我尝试使用jQuery('#wpwrap textarea'),但它总是显示第一个库。
如果我检查编辑/铅笔图标,无论我点击哪个图库,我都会看到相同的HTML代码。
<div id="mceu_60" class="mce-toolbar-grp mce-inline-toolbar-grp mce-container mce-panel mce-arrow-down" hidefocus="1" tabindex="-1" role="group" style="left: 489.969px; top: 1027.98px; display: none;">
<div id="mceu_60-body" class="mce-container-body mce-stack-layout">
<div id="mceu_61" class="mce-container mce-toolbar mce-stack-layout-item mce-first mce-last" role="toolbar">
<div id="mceu_61-body" class="mce-container-body mce-flow-layout">
<div id="mceu_62" class="mce-container mce-flow-layout-item mce-first mce-last mce-btn-group" role="group">
<div id="mceu_62-body">
<div id="mceu_58" class="mce-widget mce-btn mce-first" tabindex="-1" aria-labelledby="mceu_58" role="button" aria-label="Edit ">
<button role="presentation" type="button" tabindex="-1">
<i class="mce-ico mce-i-dashicon dashicons-edit"></i>
</button>
</div>
<div id="mceu_59" class="mce-widget mce-btn mce-last" tabindex="-1" aria-labelledby="mceu_59" role="button" aria-label="Remove">
<button role="presentation" type="button" tabindex="-1">
<i class="mce-ico mce-i-dashicon dashicons-no"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
插件代码位于https://github.com/saravr/enhanced-wp-gallery。
我知道如何区分正在编辑的“画廊”吗?