diff --git a/backport-changelog/6.9/10432.md b/backport-changelog/6.9/10432.md index 4fefda279365a1..c2e620a7e6c81f 100644 --- a/backport-changelog/6.9/10432.md +++ b/backport-changelog/6.9/10432.md @@ -1,3 +1,4 @@ https://github.com/WordPress/wordpress-develop/pull/10432 -* https://github.com/WordPress/gutenberg/pull/72770 \ No newline at end of file +* https://github.com/WordPress/gutenberg/pull/72770 +* https://github.com/WordPress/gutenberg/pull/72795 diff --git a/lib/compat/wordpress-6.9/template-activate.php b/lib/compat/wordpress-6.9/template-activate.php index 7230695adfc99d..7974cee8e38305 100644 --- a/lib/compat/wordpress-6.9/template-activate.php +++ b/lib/compat/wordpress-6.9/template-activate.php @@ -309,10 +309,12 @@ function ( $template ) { } // For any remaining slugs, use the static template. - $query = array( - 'slug__in' => $remaining_slugs, - ); - $templates = array_merge( $templates, gutenberg_get_registered_block_templates( $query ) ); + if ( ! empty( $remaining_slugs ) ) { + $query = array( + 'slug__in' => $remaining_slugs, + ); + $templates = array_merge( $templates, gutenberg_get_registered_block_templates( $query ) ); + } if ( $specific_template && in_array( $specific_template, $remaining_slugs, true ) ) { $templates = array_merge( $templates, get_block_templates( array( 'slug__in' => array( $specific_template ) ) ) );