After updating from 3.7.1 to 3.9.1 I am seeing issues with the editor within WordPress. In the environment that I have not upgraded, I am able to add content blocks and edit the block type flawlessly. I have disabled all plugins and still see the issue.
In 3.9.1, I see this error on page load:
Deprecated TinyMCE API call: <target>.onInit.add(..)
After clicking +Add Content Block:
TypeError: r is undefined (/wp-includes/js/tinymce/wp-tinymce.php?c=1&ver=4021-20140423)
After selecting the block type:
TypeError: tinyMCE.get(...) is null
I assume the issue is derived from this:
tinymce.create('tinymce.plugins.editor_toolkit', {
init : function(ed, url) {
var VK = {
DELETE: 46, BACKSPACE: 8, ENTER: 13, TAB: 9, SPACEBAR: 32, UP: 38, DOWN: 40, LEFT: 37, RIGHT: 39,
modifierPressed: function (e) {
return e.shiftKey || e.ctrlKey || e.altKey;
}
};
function scrollToThisNode(node, padding) {
vp = ed.dom.getViewPort( ed.getWin() )
y = ed.dom.getPos(node).y;
if (y < vp.y || y + padding > vp.y + vp.h) {
ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + padding);
}
}
ed.onInit.add(function(ed) {
ed.dom.addClass(ed.getBody(), 'editor-toolkit');
// Last-ditch effort to structure content
$('#post').submit(function(){
$( ed.getBody() ).children('p').each(function(){
$(this).replaceWith('<div><p>' + $(this).html() + '</p></div>');
});
return true;
});
});