From 23540c8c4d25cc72ec7de63cb1a8b98e6636710d Mon Sep 17 00:00:00 2001 From: okmttdhr Date: Fri, 5 Apr 2024 13:00:45 +0900 Subject: [PATCH] Add null check in a filter of get_block_template --- 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 3243ba39fd7810..dafda83266768e 100644 --- a/lib/compat/wordpress-6.6/resolve-patterns.php +++ b/lib/compat/wordpress-6.6/resolve-patterns.php @@ -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 );