Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
Source by support.advancedcustomfields.com #
 
PREVIOUS NEXT
Tagged: #jquery #wysiwyg #editor #val #acf
ADD COMMENT
Topic
Name
1+4 =