I have one editor where I switch between content in one editor, and what I want to do when I set the new content, I would like to reset the undo possibility.

I have read on this site http://www.tinymce.com/wiki.php/api4:class.tinymce.UndoManager

That it’s just to call tinymce.UndoManager.clear() but I just get that the function is undefined.

1
1

The global variable tinyMCE has an array of editors. So you have to call the undoManager inside them. Like this for default wp editor on post edit/create screen:

tinyMCE.editors[0].undoManager.clear();

If you want to do it in a specific editor, select the editor id in n like this:

var n = 0; // editor id
tinyMCE.editors[n].undoManager.clear();

Leave a Reply

Your email address will not be published. Required fields are marked *