• I’m working with the new Editor API, and it’s certainly a huge improvement, but I’m having issues with reinitializing editors. I have several elements that are draggable and after they are moved, I rename the textarea id/name’s.
    To start off, I initialize the elements with

    jQuery('.text-editor').each(function() {
    wp.editor.initialize(this.id, { tinymce: true, quicktags: true });
    });

    before the id/name’s are changed, I remove the editor with:

    jQuery('.text-editor').each(function() {
    wp.editor.remove(this.id);
    });

    and then after the id/name’s are changed, I reinitialize them with the first code block. However, the tinymce setting gives me issues when I attempt to reinitialize. The “Text” tab works, but the “Visual” tab doesn’t display.
    What’s up with that?

Viewing 1 replies (of 1 total)
  • Thread Starter rice_crisp

    (@rice_crisp)

    UPDATE: I’ve since narrowed the issue down to the wp_enqueue_editor() function. This function loads all of the necessary scripts for running wp.editor.initialize, but I have no way of stating my script’s dependency on it, so my script fails. Anyone know how to do that?

Viewing 1 replies (of 1 total)
  • The topic ‘New Editor API Issue’ is closed to new replies.