From b65431c7d82103afd375a5d45187e01955d81c67 Mon Sep 17 00:00:00 2001 From: ella Date: Wed, 29 Oct 2025 17:45:00 +0100 Subject: [PATCH 1/2] Template activation: skip gutenberg_get_registered_block_templates query when no slugs are left to find --- lib/compat/wordpress-6.9/template-activate.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ) ) ) ); From 772ba3ba02277e8d19bc37ab38e964b99ec6a1ea Mon Sep 17 00:00:00 2001 From: ella Date: Thu, 30 Oct 2025 13:14:59 +0100 Subject: [PATCH 2/2] Backport --- backport-changelog/6.9/10432.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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