From c732027e76959921eaff19e79c5c787e019b0ede Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 12 Jul 2021 23:56:39 +0000 Subject: [PATCH] Widgets: Replace `wp.editor` references in the legacy text widget. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes the references to `wp.editor` in the text widget’s JavaScript to `wp.oldEditor`, which is the new location for the old `editor` script that was previously available at `window.wp.editor`. Follow up to [51387-51388,51390]. Props spacedmonkey, zieladam. Fixes #53437. git-svn-id: https://develop.svn.wordpress.org/trunk@51409 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/wp/widgets/text.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/_enqueues/wp/widgets/text.js b/src/js/_enqueues/wp/widgets/text.js index c2deeefa96..ee4dbb9529 100644 --- a/src/js/_enqueues/wp/widgets/text.js +++ b/src/js/_enqueues/wp/widgets/text.js @@ -161,7 +161,7 @@ wp.textWidgets = ( function( $ ) { control.fields.text.val( syncInput.val() ); } } else if ( control.editor && ! control.editorFocused && syncInput.val() !== control.fields.text.val() ) { - control.editor.setContent( wp.editor.autop( syncInput.val() ) ); + control.editor.setContent( wp.oldEditor.autop( syncInput.val() ) ); } }, @@ -237,7 +237,7 @@ wp.textWidgets = ( function( $ ) { // The user has disabled TinyMCE. if ( typeof window.tinymce === 'undefined' ) { - wp.editor.initialize( id, { + wp.oldEditor.initialize( id, { quicktags: true, mediaButtons: true }); @@ -248,7 +248,7 @@ wp.textWidgets = ( function( $ ) { // Destroy any existing editor so that it can be re-initialized after a widget-updated event. if ( tinymce.get( id ) ) { restoreTextMode = tinymce.get( id ).isHidden(); - wp.editor.remove( id ); + wp.oldEditor.remove( id ); } // Add or enable the `wpview` plugin. @@ -262,7 +262,7 @@ wp.textWidgets = ( function( $ ) { } } ); - wp.editor.initialize( id, { + wp.oldEditor.initialize( id, { tinymce: { wpautop: true },