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.

Built from https://develop.svn.wordpress.org/branches/5.0@43942


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2018-11-23 08:35:45 +00:00
parent be60664fe1
commit 91c4d2295b
3 changed files with 4 additions and 7 deletions

View File

@ -183,10 +183,8 @@ wp_enqueue_script('inline-edit-post');
wp_enqueue_script('heartbeat');
if ( 'wp_block' === $post_type ) {
wp_enqueue_script( 'wp-list-reusable-blocks' );
wp_enqueue_style( 'wp-list-reusable-blocks' );
// wp-list-reusable-blocks enhances the page's DOM and so needs to be loaded in the footer.
wp_enqueue_script( 'wp-list-reusable-blocks', '', array(), false, true );
}
$title = $post_type_object->labels->name;

View File

@ -111,7 +111,7 @@ function wp_default_packages_vendor( &$scripts ) {
$path = "/wp-includes/js/dist/vendor/$handle$dev_suffix.js";
$version = $vendor_scripts_versions[ $handle ];
$scripts->add( $handle, $path, $dependencies, false, $version );
$scripts->add( $handle, $path, $dependencies, $version, 1 );
}
$scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) );
@ -210,7 +210,6 @@ function wp_default_packages_scripts( &$scripts ) {
'api-fetch' => '2.2.5',
'a11y' => '2.0.2',
'annotations' => '1.0.3',
'api-fetch' => '2.2.5',
'autop' => '2.0.2',
'blob' => '2.1.0',
'block-library' => '2.2.7',
@ -468,7 +467,7 @@ function wp_default_packages_scripts( &$scripts ) {
$path = "/wp-includes/js/dist/$package$suffix.js";
$version = $packages_versions[ $package ];
$scripts->add( $handle, $path, $dependencies, false, $version );
$scripts->add( $handle, $path, $dependencies, $version, 1 );
if ( isset( $package_translations[ $package ] ) ) {
$scripts->set_translations( $handle, $package_translations[ $package ] );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-beta5-43941';
$wp_version = '5.0-beta5-43942';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.