WordPress.org

Make WordPress Core

Ticket #45396: 45396.2.diff

File 45396.2.diff, 1.1 KB (added by swissspidy, 18 months ago)
  • src/wp-admin/edit.php

    diff --git src/wp-admin/edit.php src/wp-admin/edit.php
    index d85a1ea49c..b0615b8779 100644
    wp_enqueue_script('heartbeat'); 
    184184
    185185if ( 'wp_block' === $post_type ) {
    186186        wp_enqueue_style( 'wp-list-reusable-blocks' );
    187 
    188         // wp-list-reusable-blocks enhances the page's DOM and so needs to be loaded in the footer.
    189         wp_enqueue_script( 'wp-list-reusable-blocks', '', array(), false, true );
     187        wp_enqueue_script( 'wp-list-reusable-blocks' );
    190188}
    191189
    192190$title = $post_type_object->labels->name;
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index e2e2463201..78add1774e 100644
    function wp_default_packages_scripts( &$scripts ) { 
    473473                if ( isset( $package_translations[ $package ] ) ) {
    474474                        $scripts->set_translations( $handle, $package_translations[ $package ] );
    475475                }
     476
     477                // wp-list-reusable-blocks enhances the page's DOM and so needs to be loaded in the footer.
     478                if ( 'wp-list-reusable-blocks' === $handle ) {
     479                        $scripts->add_data( $handle, 'group', 1 );
     480                }
    476481        }
    477482}
    478483