From 11ad7d8adef0276203dc63fb922c853c07925833 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 8 Oct 2022 18:53:45 +0300 Subject: [PATCH 1/2] Avoid querying block templates during installation --- src/wp-includes/blocks/template-part.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/blocks/template-part.php b/src/wp-includes/blocks/template-part.php index 107f20dbd35b5..72f3f9ab2a374 100644 --- a/src/wp-includes/blocks/template-part.php +++ b/src/wp-includes/blocks/template-part.php @@ -189,6 +189,11 @@ function build_template_part_block_area_variations() { * @return array Array containing the block variation objects. */ function build_template_part_block_instance_variations() { + // Block themes are unavailable during installation. + if ( wp_installing() ) { + return; + } + $variations = array(); $template_parts = get_block_templates( array( From 6cda40364c8f106147517ac9838d877f26de0470 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 10 Oct 2022 19:43:30 +0300 Subject: [PATCH 2/2] Return an array --- src/wp-includes/blocks/template-part.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-includes/blocks/template-part.php b/src/wp-includes/blocks/template-part.php index 72f3f9ab2a374..838210480ca28 100644 --- a/src/wp-includes/blocks/template-part.php +++ b/src/wp-includes/blocks/template-part.php @@ -191,9 +191,8 @@ function build_template_part_block_area_variations() { function build_template_part_block_instance_variations() { // Block themes are unavailable during installation. if ( wp_installing() ) { - return; + return array(); } - $variations = array(); $template_parts = get_block_templates( array(