Make WordPress Core

Changeset 27004


Ignore:
Timestamp:
01/22/2014 06:16:39 PM (11 years ago)
Author:
azaozz
Message:

TinyMCE: fix initializing TinyMCE when the default editor in getUserSetting() is overridden from PHP by using the 'wp_default_editor' filter. See #24067.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r26982 r27004  
    797797
    798798        ( function() {
    799             var init, edId, qtId, firstInit,
     799            var init, edId, qtId, firstInit, override,
    800800                loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true;
    801801
     
    814814                    }
    815815
    816                     if ( ( loadMCE || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ) ) && ! init.wp_skip_init ) {
     816                    override = tinymce.DOM.hasClass( tinymce.DOM.select( '#wp-' + edId + '-wrap' )[0], 'tmce-active' );
     817                    override = override || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId );
     818
     819                    if ( ( loadMCE || override ) && ! init.wp_skip_init ) {
    817820                        try { tinymce.init( init ); } catch(e){}
    818821                    }
Note: See TracChangeset for help on using the changeset viewer.