From d2ed5529b82a1162dc0925b8e10cc0d130c05716 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 17 Dec 2018 19:07:35 +0000 Subject: [PATCH] Block Editor: Fix loading the script handling the "Manage Reusable Blocks" page. This ensures the "import from JSON" and "export JSON" buttons are shown properly. The script is loaded in the footer because it relies on the DOM being already there. Props noisysocks, mukesh27. Merges [43936] into trunk. Fixes #45396. git-svn-id: https://develop.svn.wordpress.org/trunk@44274 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index 20fb7e466f..a469bbd4b0 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -201,8 +201,10 @@ 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;