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
This commit is contained in:
Jonathan Desrosiers 2018-12-17 19:07:35 +00:00
parent 9d85e5050d
commit d2ed5529b8
1 changed files with 3 additions and 1 deletions

View File

@ -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;