diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index 7da0c55c21..264469d1cb 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -811,15 +811,28 @@ final class _WP_Editors { } } } - }()); + if ( typeof jQuery !== 'undefined' ) { + jQuery('.wp-editor-wrap').on( 'click.wp-editor', function() { + if ( this.id ) { + window.wpActiveEditor = this.id.slice( 3, -5 ); + } + }); + } else { + for ( qtId in tinyMCEPreInit.qtInit ) { + document.getElementById( 'wp-' + qtId + '-wrap' ).onclick = function() { + window.wpActiveEditor = this.id.slice( 3, -5 ); + } + } + } + }());