From 5aa4902c7de5a39166debfd4c0450fb74cbf0826 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 22 Jan 2014 18:16:39 +0000 Subject: [PATCH] TinyMCE: fix initializing TinyMCE when the default editor in getUserSetting() is overridden from PHP by using the 'wp_default_editor' filter. See #24067. git-svn-id: https://develop.svn.wordpress.org/trunk@27004 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index cd557d4e4e..b2d0f1605d 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -796,7 +796,7 @@ final class _WP_Editors { ?> ( function() { - var init, edId, qtId, firstInit, + var init, edId, qtId, firstInit, override, loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true; if ( typeof quicktags !== 'undefined' ) { @@ -813,7 +813,10 @@ final class _WP_Editors { init = firstInit = tinyMCEPreInit.mceInit[edId]; } - if ( ( loadMCE || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ) ) && ! init.wp_skip_init ) { + override = tinymce.DOM.hasClass( tinymce.DOM.select( '#wp-' + edId + '-wrap' )[0], 'tmce-active' ); + override = override || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ); + + if ( ( loadMCE || override ) && ! init.wp_skip_init ) { try { tinymce.init( init ); } catch(e){} } }