Merged in feature/81-dev-dev01 (pull request #5)

auto-patch  81-dev-dev01-2023-12-05T22_45_26

* auto-patch  81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
Tony Volpe
2023-12-05 23:05:59 +00:00
parent ba16964e7a
commit 725d3043d5
1463 changed files with 142461 additions and 89421 deletions

View File

@@ -7,8 +7,6 @@
/**
* Registers the `core/pattern` block on the server.
*
* @return void
*/
function register_block_core_pattern() {
register_block_type_from_metadata(
@@ -41,7 +39,16 @@ function render_block_core_pattern( $attributes ) {
}
$pattern = $registry->get_registered( $slug );
return do_blocks( $pattern['content'] );
$content = $pattern['content'];
// Backward compatibility for handling Block Hooks and injecting the theme attribute in the Gutenberg plugin.
// This can be removed when the minimum supported WordPress is >= 6.4.
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && ! function_exists( 'traverse_and_serialize_blocks' ) ) {
$blocks = parse_blocks( $content );
$content = gutenberg_serialize_blocks( $blocks );
}
return do_blocks( $content );
}
add_action( 'init', 'register_block_core_pattern' );