Make WordPress Core

Ticket #52818: 52818.diff

File 52818.diff, 1.3 KB (added by ribaricplusplus, 3 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 7e335fa49b..a45cb40509 100644
    a b $editor_settings = get_block_editor_settings( $editor_settings, $block_editor_co 
    265265
    266266$init_script = <<<JS
    267267( function() {
    268         window._wpLoadBlockEditor = new Promise( function( resolve ) {
    269                 wp.domReady( function() {
    270                         resolve( wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s ) );
    271                 } );
     268        wp.domReady( function() {
     269                wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s );
    272270        } );
    273271} )();
    274272JS;
  • src/wp-admin/includes/post.php

    diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
    index 718e18d1d5..7d5013e2a3 100644
    a b function the_block_editor_meta_boxes() { 
    23322332         * admin_head fires after admin_enqueue_scripts, which is where we create our
    23332333         * editor instance.
    23342334         */
    2335         $script = 'window._wpLoadBlockEditor.then( function() {
    2336                 wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' );
    2337         } );';
     2335        $script = ' wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' );';
    23382336
    23392337        wp_add_inline_script( 'wp-edit-post', $script );
    23402338