jQuery-在tinyMCE所见即所得中选择元素

问题描述:

我有一个包含一些WYSIWYG字段的站点(将TinyMCE与Wordpress和amp; Advanced Custom Fields一起使用).我想选择和操作这些字段中的某些元素(添加背景图像),但是我不确定该怎么做.

I have a site with some WYSIWYG-fields (using TinyMCE with Wordpress & Advanced Custom Fields). I want to select and manipulate some elements inside these fields (add a background image) but I'm not sure how to do that.

如何进入TinyMCE的iFrame并修改元素? 选择它们之前,如何确保所有所见即所得字段均已正确加载?

How can I reach inside TinyMCE's iFrame and modify elements? How can I make sure all WYSIWYG-fields are properly loaded before I select them?

我正在查看TinyMCE 4 API,但仍然没有任何线索.

I'm looking at TinyMCE 4 API, and I still have no clue.

您可以使用init_instance_callback函数设置iframe属性.

You can use init_instance_callback function to set the iframe properties.