如果您等待SetupEditor
事件,然后您可以访问编辑器:
add_action( \'admin_print_footer_scripts\', function () {
?>
<script type="text/javascript">
jQuery(function ($) {
if (typeof tinymce !== \'undefined\') {
tinymce.on(\'SetupEditor\', function (editor) {
if (editor.id === \'contentLeft\') {
// Could use new \'input\' event instead.
editor.on(\'change keyup paste\', function (event) {
console.log(\'content=%s\', this.getContent());
});
}
});
}
});
</script>
<?php
} );