Make WordPress Core

Changeset 51409


Ignore:
Timestamp:
07/12/2021 11:56:39 PM (3 years ago)
Author:
desrosj
Message:

Widgets: Replace wp.editor references in the legacy text widget.

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/widgets/text.js

    r50420 r51409  
    162162                }
    163163            } else if ( control.editor && ! control.editorFocused && syncInput.val() !== control.fields.text.val() ) {
    164                 control.editor.setContent( wp.editor.autop( syncInput.val() ) );
     164                control.editor.setContent( wp.oldEditor.autop( syncInput.val() ) );
    165165            }
    166166        },
     
    238238                // The user has disabled TinyMCE.
    239239                if ( typeof window.tinymce === 'undefined' ) {
    240                     wp.editor.initialize( id, {
     240                    wp.oldEditor.initialize( id, {
    241241                        quicktags: true,
    242242                        mediaButtons: true
     
    249249                if ( tinymce.get( id ) ) {
    250250                    restoreTextMode = tinymce.get( id ).isHidden();
    251                     wp.editor.remove( id );
     251                    wp.oldEditor.remove( id );
    252252                }
    253253
     
    263263                } );
    264264
    265                 wp.editor.initialize( id, {
     265                wp.oldEditor.initialize( id, {
    266266                    tinymce: {
    267267                        wpautop: true
Note: See TracChangeset for help on using the changeset viewer.