wp_editor textarea value not updating

tinyMCE <textarea> element is initially unseen by the used serialize function:

$.post(
    ajaxurl,
    $('#addtag').serialize(), function(r) {
        // Content here.
    }
});

You will need to call tinyMCE.triggerSave() to make it visible.

Below is a simple snippet that should do the trick:

jQuery('#submit').mousedown( function() {
    tinyMCE.triggerSave();
});

This in an external file, enqueued with wp_enqueue_script(); it worked for the test I’ve conducted.

Leave a Comment