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
This commit is contained in:
Peter Wilson 2022-04-29 03:50:14 +00:00
parent 8e29ebbc16
commit eebb76a64f
2 changed files with 6 additions and 1 deletions

View File

@ -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();

View File

@ -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.