From bd2a5cef656fbfe755f9ea994ca5fd0601efb7fb Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 29 Sep 2022 08:13:07 -0700 Subject: [PATCH] Avoid querying block templates during installation The database tables don't yet exist. --- packages/block-library/src/template-part/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/block-library/src/template-part/index.php b/packages/block-library/src/template-part/index.php index 107f20dbd35b5e..838210480ca288 100644 --- a/packages/block-library/src/template-part/index.php +++ b/packages/block-library/src/template-part/index.php @@ -189,6 +189,10 @@ 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 array(); + } $variations = array(); $template_parts = get_block_templates( array(