Skip to content

Commit

Permalink
Add null check in a filter of get_block_template
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr committed Apr 5, 2024
1 parent be4e95a commit 23540c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/compat/wordpress-6.6/resolve-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ function gutenberg_replace_pattern_blocks_get_block_templates( $templates ) {
}

function gutenberg_replace_pattern_blocks_get_block_template( $template ) {
if ( null === $template ) {
return $template;
}
$blocks = parse_blocks( $template->content );
$blocks = gutenberg_replace_pattern_blocks( $blocks );
$template->content = serialize_blocks( $blocks );
Expand Down

0 comments on commit 23540c8

Please sign in to comment.