From e188e2d3a3b0c24e03295d6465e3c2e4201217fd Mon Sep 17 00:00:00 2001 From: desrosj Date: Mon, 17 Dec 2018 19:34:52 +0000 Subject: [PATCH] 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, youknowriad. Merges [43942] into trunk. Fixes #45402. See #45396. Built from https://develop.svn.wordpress.org/trunk@44277 git-svn-id: http://core.svn.wordpress.org/trunk@44107 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit.php | 4 +--- wp-includes/script-loader.php | 4 ++-- wp-includes/version.php | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index a469bbd4b0..20fb7e466f 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -201,10 +201,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; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 5ce5d45557..2501c53f9d 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -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' ) ); @@ -466,7 +466,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 ] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6cbbb289ff..848e7b94e2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44276'; +$wp_version = '5.1-alpha-44277'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.