Make WordPress Core

Changeset 51749 for branches/5.8


Ignore:
Timestamp:
09/08/2021 07:23:39 PM (3 years ago)
Author:
SergeyBiryukov
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.
Merges [51748] to the 5.8 branch.
Fixes #53762.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/class-wp-editor.php

    r51656 r51749  
    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.