Make WordPress Core

Changeset 51748


Ignore:
Timestamp:
09/08/2021 07:14:49 PM (3 years ago)
Author:
azaozz
Message:

Editor: fix the replacement of wp.editor with wp.oldEditor in the inline script outputted when enqueueing the old editor.

Props fullofcaffeine, davidbinda, grantmkin, get_dave, azaozz.
Fixes #53762.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r51649 r51748  
    970970        <script type="text/javascript">
    971971        window.wp = window.wp || {};
    972         window.wp.editor = window.wp.oldEditor = window.wp.oldEditor || {};
    973         window.wp.oldEditor.getDefaultSettings = function() {
     972        window.wp.editor = window.wp.editor || {};
     973        window.wp.oldEditor = window.wp.oldEditor || {};
     974
     975        // Add getDefaultSettings() to both wp.editor and wp.oldEditor for back compat.
     976        // Use of wp.editor for "old editor" functionality should be deprecated.
     977        window.wp.editor.getDefaultSettings = window.wp.oldEditor.getDefaultSettings = function() {
    974978            return {
    975979                tinymce: <?php echo $settings; ?>,
Note: See TracChangeset for help on using the changeset viewer.