Make WordPress Core

Changeset 51416 for branches/5.8


Ignore:
Timestamp:
07/13/2021 01:44:07 PM (5 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, SergeyBiryukov.
Merges [51409] to the 5.8 branch.
Fixes #53437.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/js/_enqueues/wp/widgets/text.js

    r50420 r51416  
    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.