Skip to content
Permalink
Browse files

Block Editor: Fix loading the script handling the "Manage Reusable Bl…

…ocks" 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.
Fixes #45396.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43936 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
youknowriad committed Nov 22, 2018
1 parent 6bf7597 commit 6151007fecbea7c7a46ff2e0277a0beb9d08e625
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/wp-admin/edit.php
@@ -183,8 +183,10 @@
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;

0 comments on commit 6151007

Please sign in to comment.
You can’t perform that action at this time.