Console Errors when the New Product Editor is enabled (#39027)

* Bootstrap server side block definitions

* Add changelog file

* Revert action priority to its prev value

* Check if unstable__bootstrapServerSideBlockDefinitions function exists before call it
This commit is contained in:
Maikel David Pérez Gómez 2023-07-05 14:32:04 -04:00 committed by GitHub
parent c9d4324b43
commit 98b9670848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Bootstrap server side block definitions

View File

@ -720,6 +720,11 @@ class Init {
// not be the product edit page (it mostly likely isn't).
if ( PageController::is_admin_page() ) {
$screen->is_block_editor( true );
wp_add_inline_script(
'wp-blocks',
'wp.blocks && wp.blocks.unstable__bootstrapServerSideBlockDefinitions && wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'
);
}
}
}