From 5ae81053ce46b8c1afa42aa525170c3fb4c0b860 Mon Sep 17 00:00:00 2001 From: "okmttdhr, tada" Date: Fri, 5 Apr 2024 17:57:45 +0900 Subject: [PATCH] Add null check to prevent errors in `get_block_template` filter (#60491) --- lib/compat/wordpress-6.6/resolve-patterns.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compat/wordpress-6.6/resolve-patterns.php b/lib/compat/wordpress-6.6/resolve-patterns.php index f9d9cd675987d..d20da6a5dd6b7 100644 --- a/lib/compat/wordpress-6.6/resolve-patterns.php +++ b/lib/compat/wordpress-6.6/resolve-patterns.php @@ -64,6 +64,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 );