WordPress.org

Make WordPress Core

Changeset 43942


Ignore:
Timestamp:
11/23/2018 08:34:44 AM (10 months ago)
Author:
youknowriad
Message:

Block Editor: Fix the WordPress packages and vendor script registration.

The version is set properly and the scripts are automatically loaded in the footer.
This patch also includes a revert for the reusable blocks enqueue script.

Props pento, swissspidy.
Fixes #45402.
See #45396.

Location:
branches/5.0/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/edit.php

    r43936 r43942  
    184184
    185185if ( 'wp_block' === $post_type ) {
     186    wp_enqueue_script( 'wp-list-reusable-blocks' );
    186187    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 );
    190188}
    191189
  • branches/5.0/src/wp-includes/script-loader.php

    r43939 r43942  
    112112        $version = $vendor_scripts_versions[ $handle ];
    113113
    114         $scripts->add( $handle, $path, $dependencies, false, $version );
     114        $scripts->add( $handle, $path, $dependencies, $version, 1 );
    115115    }
    116116
     
    211211        'a11y' => '2.0.2',
    212212        'annotations' => '1.0.3',
    213         'api-fetch' => '2.2.5',
    214213        'autop' => '2.0.2',
    215214        'blob' => '2.1.0',
     
    469468        $version = $packages_versions[ $package ];
    470469
    471         $scripts->add( $handle, $path, $dependencies, false, $version );
     470        $scripts->add( $handle, $path, $dependencies, $version, 1 );
    472471
    473472        if ( isset( $package_translations[ $package ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.