Answers for "jquery wysiwyg editor val acf"

1

jquery wysiwyg editor val acf

/* 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);
Posted by: Guest on January-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language