WordPress.org

Make WordPress Core

Changeset 51770


Ignore:
Timestamp:
09/09/2021 01:59:03 AM (6 weeks ago)
Author:
azaozz
Message:

Editor: Revert [51748] and [51649]. They intorduced a bug where wp.editor may be replaced with wp.oldEditor in certain cases.

Props desrosj, davidbinda, azaozz.
Merges [51768] to the 5.8 branch.
Fixes #53762.

Location:
branches/5.8
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/js/_enqueues/lib/quicktags.js

    r51656 r51770  
    436436            val = this.display ? ' value="' + _escape( this.display ) + '"' : '',
    437437            id = this.id ? ' id="' + _escape( idPrefix + this.id ) + '"' : '',
    438             dfw = ( wp = window.wp ) && wp.oldEditor && wp.oldEditor.dfw;
     438            dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw;
    439439
    440440        if ( this.id === 'fullscreen' ) {
     
    682682        var wp;
    683683
    684         if ( ! ( wp = window.wp ) || ! wp.oldEditor || ! wp.oldEditor.dfw ) {
     684        if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) {
    685685            return;
    686686        }
    687687
    688         window.wp.oldEditor.dfw.toggle();
     688        window.wp.editor.dfw.toggle();
    689689    };
    690690
  • branches/5.8/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js

    r51656 r51770  
    1313        $ = window.jQuery,
    1414        wp = window.wp,
    15         hasWpautop = ( wp && wp.oldEditor && wp.oldEditor.autop && editor.getParam( 'wpautop', true ) ),
     15        hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ),
    1616        wpTooltips = false;
    1717
     
    131131            if ( event.load && event.format !== 'raw' ) {
    132132                if ( hasWpautop ) {
    133                     event.content = wp.oldEditor.autop( event.content );
     133                    event.content = wp.editor.autop( event.content );
    134134                } else {
    135135                    // Prevent creation of paragraphs out of multiple HTML comments.
     
    602602
    603603        if ( hasWpautop ) {
    604             event.content = wp.oldEditor.removep( event.content );
     604            event.content = wp.editor.removep( event.content );
    605605        } else {
    606606            // Restore formatting of block boundaries.
  • branches/5.8/src/js/_enqueues/wp/editor/base.js

    r51656 r51770  
    66
    77( function( $, wp ) {
    8     wp.editor = wp.oldEditor = wp.oldEditor || {};
     8    wp.editor = wp.editor || {};
    99
    1010    /**
     
    11921192        }
    11931193
    1194         wp.oldEditor.autop = wpautop;
    1195         wp.oldEditor.removep = pre_wpautop;
     1194        wp.editor.autop = wpautop;
     1195        wp.editor.removep = pre_wpautop;
    11961196
    11971197        exports = {
     
    12421242     * }
    12431243     */
    1244     wp.oldEditor.initialize = function( id, settings ) {
     1244    wp.editor.initialize = function( id, settings ) {
    12451245        var init;
    12461246        var defaults;
    12471247
    1248         if ( ! $ || ! id || ! wp.oldEditor.getDefaultSettings ) {
     1248        if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) {
    12491249            return;
    12501250        }
    12511251
    1252         defaults = wp.oldEditor.getDefaultSettings();
     1252        defaults = wp.editor.getDefaultSettings();
    12531253
    12541254        // Initialize TinyMCE by default.
     
    13501350     * Remove one editor instance.
    13511351     *
    1352      * Intended for use with editors that were initialized with wp.oldEditor.initialize().
     1352     * Intended for use with editors that were initialized with wp.editor.initialize().
    13531353     *
    13541354     * @since 4.8.0
     
    13561356     * @param {string} id The HTML id of the editor textarea.
    13571357     */
    1358     wp.oldEditor.remove = function( id ) {
     1358    wp.editor.remove = function( id ) {
    13591359        var mceInstance, qtInstance,
    13601360            $wrap = $( '#wp-' + id + '-wrap' );
     
    13891389     * Get the editor content.
    13901390     *
    1391      * Intended for use with editors that were initialized with wp.oldEditor.initialize().
     1391     * Intended for use with editors that were initialized with wp.editor.initialize().
    13921392     *
    13931393     * @since 4.8.0
     
    13961396     * @return The editor content.
    13971397     */
    1398     wp.oldEditor.getContent = function( id ) {
     1398    wp.editor.getContent = function( id ) {
    13991399        var editor;
    14001400
  • branches/5.8/src/js/_enqueues/wp/editor/dfw.js

    r51656 r51770  
    3434            $postboxContainer = $( '#postbox-container-1' ),
    3535            $postBody = $('#post-body'),
    36             fullscreen = window.wp.oldEditor && window.wp.oldEditor.fullscreen,
     36            fullscreen = window.wp.editor && window.wp.editor.fullscreen,
    3737            mceEditor,
    3838            mceBind = function(){},
     
    16041604
    16051605        window.wp = window.wp || {};
    1606         window.wp.oldEditor = window.wp.oldEditor || {};
    1607         window.wp.oldEditor.dfw = {
     1606        window.wp.editor = window.wp.editor || {};
     1607        window.wp.editor.dfw = {
    16081608            activate: activate,
    16091609            deactivate: deactivate,
  • branches/5.8/src/wp-includes/class-wp-editor.php

    r51749 r51770  
    971971        window.wp = window.wp || {};
    972972        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() {
     973        window.wp.editor.getDefaultSettings = function() {
    978974            return {
    979975                tinymce: <?php echo $settings; ?>,
  • branches/5.8/src/wp-includes/general-template.php

    r51656 r51770  
    35253525 *
    35263526 * The editor can be initialized when needed after page load.
    3527  * See wp.oldEditor.initialize() in wp-admin/js/editor.js for initialization options.
     3527 * See wp.editor.initialize() in wp-admin/js/editor.js for initialization options.
    35283528 *
    35293529 * @uses _WP_Editors
Note: See TracChangeset for help on using the changeset viewer.