From eebb76a64f3879c194a6d02d19dababc3a831b43 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 29 Apr 2022 03:50:14 +0000 Subject: [PATCH] Install: Prevent DB errors caused by web fonts API. Bypass checking `theme.json` for web fonts during the installation of WordPress. During installation the active theme is considered to be Twenty Twenty-Two (the default theme). As a block theme this prompts a database call when the web fonts API checks the `theme.json` settings, this triggers a database error during installation as the database tables do not exist. Props chouby, costdev, peterwilsoncc, sergeybiryukov. Fixes #55632. Built from https://develop.svn.wordpress.org/trunk@53306 git-svn-id: http://core.svn.wordpress.org/trunk@52895 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index abe176cd83..6bdbc5c2f4 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -3057,6 +3057,11 @@ function wp_enqueue_block_style( $block_name, $args ) { * @access private */ function _wp_theme_json_webfonts_handler() { + // Block themes are unavailable during installation. + if ( wp_installing() ) { + return; + } + // Webfonts to be processed. $registered_webfonts = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 085f7de242..24db4d7e7b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-beta3-53305'; +$wp_version = '6.0-beta3-53306'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.