0

I am trying to add default content when I fire wp.editor.initialize(). This is code.

  wp.editor.initialize( editor_id, {
      mediaButtons: true,
      quicktags: true,
      tinymce: {
        wpautop:true 
      },
    } );

I am looking for a way to add content when this loads. I have tried .

 tinymce.activeEditor.setContent('content');

and

 tinymce.get(editor_id).setContent('content');

Feel like I am missing something. Thanks for any help.

  • Can you not just output content inside the textarea that you're making into an editor? – Jacob Peattie Dec 7 '18 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.