Make WordPress Core


Ignore:
Timestamp:
02/25/2014 07:30:46 PM (13 years ago)
Author:
azaozz
Message:

Set wpActiveEditor to the id of the first instance on init, props kovshenin, fixes #27210.

File:
1 edited

Legend:

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

    r27193 r27270  
    801801                                loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true;
    802802
    803                         if ( typeof quicktags !== 'undefined' ) {
    804                                 for ( qtId in tinyMCEPreInit.qtInit ) {
    805                                         try { quicktags( tinyMCEPreInit.qtInit[qtId] ); } catch(e){};
    806                                 }
    807                         }
    808 
    809803                        if ( typeof tinymce !== 'undefined' ) {
    810804                                for ( edId in tinyMCEPreInit.mceInit ) {
    … …  
    819813
    820814                                        if ( ( loadMCE || override ) && ! init.wp_skip_init ) {
    821                                                 try { tinymce.init( init ); } catch(e){}
     815                                                try {
     816                                                        tinymce.init( init );
     817
     818                                                        if ( ! window.wpActiveEditor ) {
     819                                                                window.wpActiveEditor = edId;
     820                                                        }
     821                                                } catch(e){}
    822822                                        }
     823                                }
     824                        }
     825
     826                        if ( typeof quicktags !== 'undefined' ) {
     827                                for ( qtId in tinyMCEPreInit.qtInit ) {
     828                                        try {
     829                                                quicktags( tinyMCEPreInit.qtInit[qtId] );
     830
     831                                                if ( ! window.wpActiveEditor ) {
     832                                                        window.wpActiveEditor = qtId;
     833                                                }
     834                                        } catch(e){};
    823835                                }
    824836                        }
Note: See TracChangeset for help on using the changeset viewer.