WordPress.org

Make WordPress Core

Ticket #45338: 45338.diff

File 45338.diff, 1.2 KB (added by pento, 2 years ago)
  • src/wp-admin/edit-form-blocks.php

    diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php
    index 30b5b2d64e..1e46900093 100644
    a b wp_enqueue_media( 
    325325                'post' => $post->ID,
    326326        )
    327327);
     328wp_tinymce_inline_scripts();
    328329wp_enqueue_editor();
    329330
    330331/**
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 6cf83b6f9c..0736858041 100644
    a b function wp_default_packages_inline_scripts( &$scripts ) { 
    484484                'window.wp.oldEditor = window.wp.editor;',
    485485                'after'
    486486        );
     487}
     488
     489/**
     490 * Adds inline scripts required for the TinyMCE in the block editor.
     491 *
     492 * @since 5.0.0
     493 *
     494 * @global WP_Scripts $wp_scripts
     495 */
     496function wp_tinymce_inline_scripts() {
     497        global $wp_scripts;
    487498
    488         // TinyMCE init.
    489499        $tinymce_plugins = array(
    490500                'charmap',
    491501                'colorpicker',
    function wp_default_packages_inline_scripts( &$scripts ) { 
    596606                }
    597607        }';
    598608
    599         $scripts->add_inline_script( 'wp-block-library', $script, 'before' );
     609        $wp_scripts->add_inline_script( 'wp-block-library', $script, 'before' );
    600610}
    601611
    602612/**