WordPress.org

Make WordPress Core

Changeset 51649


Ignore:
Timestamp:
08/21/2021 12:18:25 AM (4 weeks ago)
Author:
azaozz
Message:

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

Props zieladam.
Fixes #53762.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/quicktags.js

    r50547 r51649  
    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
  • trunk/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js

    r49911 r51649  
    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.
  • trunk/src/js/_enqueues/wp/editor/base.js

    r50547 r51649  
    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
  • trunk/src/js/_enqueues/wp/editor/dfw.js

    r48650 r51649  
    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,
  • trunk/src/wp-includes/class-wp-editor.php

    r51402 r51649  
    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; ?>,
  • trunk/src/wp-includes/general-template.php

    r51592 r51649  
    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.