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.



git-svn-id: https://develop.svn.wordpress.org/trunk@53306 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson
2022-04-29 03:48:48 +00:00
parent 613cac5a2d
commit c70c7ad811

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