Skip to content

Commit a90752e

Browse files
Fix: Server side rendered blocks are not parsed on the widgets screen. (#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.
1 parent be8add9 commit a90752e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/widgets-page.php

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ function gutenberg_widgets_init( $hook ) {
3333
'wp-edit-widgets',
3434
'wp.editWidgets.initialize( "widgets-editor" );'
3535
);
36+
// Preload server-registered block schemas.
37+
wp_add_inline_script(
38+
'wp-blocks',
39+
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'
40+
);
3641
wp_enqueue_script( 'wp-edit-widgets' );
3742
wp_enqueue_style( 'wp-edit-widgets' );
3843
}

0 commit comments

Comments
 (0)