From dd5f6c7b1003d30a4674c4c8ef5e1e7d8574e51f Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Thu, 30 Mar 2023 11:08:21 +0000 Subject: [PATCH] Script Loader: Return early in _wp_theme_json_webfonts_handler if theme.json not present. Check to see if the theme.json file exists before processing the rest of the code in `_wp_theme_json_webfonts_handler`. This improves performance by not trying to parse the theme.json, early in the bootstrap process. Props spacedmonkey, hellofromTonya, flixos90. Fixes #57814. Built from https://develop.svn.wordpress.org/trunk@55612 git-svn-id: http://core.svn.wordpress.org/trunk@55124 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index cd84a19f6c..e0e01299a0 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -3225,6 +3225,10 @@ function _wp_theme_json_webfonts_handler() { return; } + if ( ! wp_theme_has_theme_json() ) { + return; + } + // Webfonts to be processed. $registered_webfonts = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6bb7403feb..092c930c12 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55608'; +$wp_version = '6.3-alpha-55612'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.