Make WordPress Core

Changeset 51656 for branches/5.8


Ignore:
Timestamp:
08/25/2021 06:47:22 PM (3 years ago)
Author:
desrosj
Message:

Editor: Replace the remaining references to wp.editor with wp.oldEditor.

Props zieladam, azaozz.
Merges [51649] 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

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

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

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

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

    r51407 r51656  
    970970        <script type="text/javascript">
    971971        window.wp = window.wp || {};
    972         window.wp.editor = window.wp.editor || {};
    973         window.wp.editor.getDefaultSettings = function() {
     972        window.wp.editor = window.wp.oldEditor = window.wp.oldEditor || {};
     973        window.wp.oldEditor.getDefaultSettings = function() {
    974974            return {
    975975                tinymce: <?php echo $settings; ?>,
  • branches/5.8/src/wp-includes/general-template.php

    r51048 r51656  
    35253525 *
    35263526 * The editor can be initialized when needed after page load.
    3527  * See wp.editor.initialize() in wp-admin/js/editor.js for initialization options.
     3527 * See wp.oldEditor.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.