Skip to content

Commit a2c0ccd

Browse files
committed
Editor: Replace the remaining references to wp.editor with wp.oldEditor.
Props zieladam. Fixes #53762. git-svn-id: https://develop.svn.wordpress.org/trunk@51649 602fd350-edb4-49c9-b593-d223f7449a82
1 parent fe3d953 commit a2c0ccd

6 files changed

Lines changed: 22 additions & 22 deletions

File tree

src/js/_enqueues/lib/quicktags.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ window.edToolbar = function(){};
435435
ariaLabel = this.attr && this.attr.ariaLabel ? ' aria-label="' + _escape( this.attr.ariaLabel ) + '"' : '',
436436
val = this.display ? ' value="' + _escape( this.display ) + '"' : '',
437437
id = this.id ? ' id="' + _escape( idPrefix + this.id ) + '"' : '',
438-
dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw;
438+
dfw = ( wp = window.wp ) && wp.oldEditor && wp.oldEditor.dfw;
439439

440440
if ( this.id === 'fullscreen' ) {
441441
return '<button type="button"' + id + ' class="ed_button qt-dfw qt-fullscreen"' + title + ariaLabel + '></button>';
@@ -681,11 +681,11 @@ window.edToolbar = function(){};
681681
qt.DFWButton.prototype.callback = function() {
682682
var wp;
683683

684-
if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) {
684+
if ( ! ( wp = window.wp ) || ! wp.oldEditor || ! wp.oldEditor.dfw ) {
685685
return;
686686
}
687687

688-
window.wp.editor.dfw.toggle();
688+
window.wp.oldEditor.dfw.toggle();
689689
};
690690

691691
qt.TextDirectionButton = function() {

src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
1212
__ = editor.editorManager.i18n.translate,
1313
$ = window.jQuery,
1414
wp = window.wp,
15-
hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ),
15+
hasWpautop = ( wp && wp.oldEditor && wp.oldEditor.autop && editor.getParam( 'wpautop', true ) ),
1616
wpTooltips = false;
1717

1818
if ( $ ) {
@@ -130,7 +130,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
130130

131131
if ( event.load && event.format !== 'raw' ) {
132132
if ( hasWpautop ) {
133-
event.content = wp.editor.autop( event.content );
133+
event.content = wp.oldEditor.autop( event.content );
134134
} else {
135135
// Prevent creation of paragraphs out of multiple HTML comments.
136136
event.content = event.content.replace( /-->\s+<!--/g, '--><!--' );
@@ -601,7 +601,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
601601
event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p>&nbsp;</p>' );
602602

603603
if ( hasWpautop ) {
604-
event.content = wp.editor.removep( event.content );
604+
event.content = wp.oldEditor.removep( event.content );
605605
} else {
606606
// Restore formatting of block boundaries.
607607
event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' );

src/js/_enqueues/wp/editor/base.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
window.wp = window.wp || {};
66

77
( function( $, wp ) {
8-
wp.editor = wp.editor || {};
8+
wp.editor = wp.oldEditor = wp.oldEditor || {};
99

1010
/**
1111
* Utility functions for the editor.
@@ -1191,8 +1191,8 @@ window.wp = window.wp || {};
11911191
} );
11921192
}
11931193

1194-
wp.editor.autop = wpautop;
1195-
wp.editor.removep = pre_wpautop;
1194+
wp.oldEditor.autop = wpautop;
1195+
wp.oldEditor.removep = pre_wpautop;
11961196

11971197
exports = {
11981198
go: switchEditor,
@@ -1241,15 +1241,15 @@ window.wp = window.wp || {};
12411241
* }
12421242
* }
12431243
*/
1244-
wp.editor.initialize = function( id, settings ) {
1244+
wp.oldEditor.initialize = function( id, settings ) {
12451245
var init;
12461246
var defaults;
12471247

1248-
if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) {
1248+
if ( ! $ || ! id || ! wp.oldEditor.getDefaultSettings ) {
12491249
return;
12501250
}
12511251

1252-
defaults = wp.editor.getDefaultSettings();
1252+
defaults = wp.oldEditor.getDefaultSettings();
12531253

12541254
// Initialize TinyMCE by default.
12551255
if ( ! settings ) {
@@ -1349,13 +1349,13 @@ window.wp = window.wp || {};
13491349
/**
13501350
* Remove one editor instance.
13511351
*
1352-
* Intended for use with editors that were initialized with wp.editor.initialize().
1352+
* Intended for use with editors that were initialized with wp.oldEditor.initialize().
13531353
*
13541354
* @since 4.8.0
13551355
*
13561356
* @param {string} id The HTML id of the editor textarea.
13571357
*/
1358-
wp.editor.remove = function( id ) {
1358+
wp.oldEditor.remove = function( id ) {
13591359
var mceInstance, qtInstance,
13601360
$wrap = $( '#wp-' + id + '-wrap' );
13611361

@@ -1388,14 +1388,14 @@ window.wp = window.wp || {};
13881388
/**
13891389
* Get the editor content.
13901390
*
1391-
* Intended for use with editors that were initialized with wp.editor.initialize().
1391+
* Intended for use with editors that were initialized with wp.oldEditor.initialize().
13921392
*
13931393
* @since 4.8.0
13941394
*
13951395
* @param {string} id The HTML id of the editor textarea.
13961396
* @return The editor content.
13971397
*/
1398-
wp.editor.getContent = function( id ) {
1398+
wp.oldEditor.getContent = function( id ) {
13991399
var editor;
14001400

14011401
if ( ! $ || ! id ) {

src/js/_enqueues/wp/editor/dfw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
$sideSortables = $( '#side-sortables' ),
3434
$postboxContainer = $( '#postbox-container-1' ),
3535
$postBody = $('#post-body'),
36-
fullscreen = window.wp.editor && window.wp.editor.fullscreen,
36+
fullscreen = window.wp.oldEditor && window.wp.oldEditor.fullscreen,
3737
mceEditor,
3838
mceBind = function(){},
3939
mceUnbind = function(){},
@@ -1603,8 +1603,8 @@
16031603
}
16041604

16051605
window.wp = window.wp || {};
1606-
window.wp.editor = window.wp.editor || {};
1607-
window.wp.editor.dfw = {
1606+
window.wp.oldEditor = window.wp.oldEditor || {};
1607+
window.wp.oldEditor.dfw = {
16081608
activate: activate,
16091609
deactivate: deactivate,
16101610
isActive: isActive,

src/wp-includes/class-wp-editor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,8 @@ public static function print_default_editor_scripts() {
969969
?>
970970
<script type="text/javascript">
971971
window.wp = window.wp || {};
972-
window.wp.editor = window.wp.editor || {};
973-
window.wp.editor.getDefaultSettings = function() {
972+
window.wp.editor = window.wp.oldEditor = window.wp.oldEditor || {};
973+
window.wp.oldEditor.getDefaultSettings = function() {
974974
return {
975975
tinymce: <?php echo $settings; ?>,
976976
quicktags: {

src/wp-includes/general-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3524,7 +3524,7 @@ function wp_editor( $content, $editor_id, $settings = array() ) {
35243524
* Outputs the editor scripts, stylesheets, and default settings.
35253525
*
35263526
* The editor can be initialized when needed after page load.
3527-
* See wp.editor.initialize() in wp-admin/js/editor.js for initialization options.
3527+
* See wp.oldEditor.initialize() in wp-admin/js/editor.js for initialization options.
35283528
*
35293529
* @uses _WP_Editors
35303530
* @since 4.8.0

0 commit comments

Comments
 (0)