From 8cae5c7ab7bfce132d8e411db119d61b07dd397d Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 2 Mar 2014 23:25:25 +0000 Subject: [PATCH] Editor: look at the class of the wrapper element instead of `getUserSetting('editor')` to determine the default editor, fixes #27257 git-svn-id: https://develop.svn.wordpress.org/trunk@27364 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index 004ec9159e..29796be60b 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -797,8 +797,7 @@ final class _WP_Editors { ?> ( function() { - var init, edId, qtId, firstInit, override, - loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true; + var init, edId, qtId, firstInit, wrapper; if ( typeof tinymce !== 'undefined' ) { for ( edId in tinyMCEPreInit.mceInit ) { @@ -808,10 +807,11 @@ final class _WP_Editors { init = firstInit = tinyMCEPreInit.mceInit[edId]; } - override = tinymce.DOM.hasClass( tinymce.DOM.select( '#wp-' + edId + '-wrap' )[0], 'tmce-active' ); - override = override || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ); + wrapper = tinymce.DOM.select( '#wp-' + edId + '-wrap' )[0]; + + if ( ( tinymce.DOM.hasClass( wrapper, 'tmce-active' ) || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ) ) && + ! init.wp_skip_init ) { - if ( ( loadMCE || override ) && ! init.wp_skip_init ) { try { tinymce.init( init );