📜  jquery wysiwyg editor val acf - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:16.657000             🧑  作者: Mango

代码示例1
/* You have to find your ACF field, find the textarea within the editor,
get that ID, then setContent using TinyMCE JS API that's built in to
WordPress: */
let description = "Some text!";
let f = acf.getField("your_field_key");
let tinyID = f.$el.find("textarea").attr("id");
let tinyInstance = tinyMCE.editors[tinyID];
tinyInstance.setContent(description);