Skip to content

Commit

Permalink
Fix: Server side rendered blocks are not parsed on the widgets screen. (
Browse files Browse the repository at this point in the history
#15414)

Server-side rendered blocks are not being correctly parsed on widgets screen making legacy widget blocks not load correctly on #15074.
The problem was that the server side block definitions were not being bootstrapped on the widgets page.
  • Loading branch information
jorgefilipecosta authored May 6, 2019
1 parent be8add9 commit a90752e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/widgets-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function gutenberg_widgets_init( $hook ) {
'wp-edit-widgets',
'wp.editWidgets.initialize( "widgets-editor" );'
);
// Preload server-registered block schemas.
wp_add_inline_script(
'wp-blocks',
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'
);
wp_enqueue_script( 'wp-edit-widgets' );
wp_enqueue_style( 'wp-edit-widgets' );
}
Expand Down

0 comments on commit a90752e

Please sign in to comment.