Skip to content

Commit

Permalink
Script Loader: Return early in _wp_theme_json_webfonts_handler if the…
Browse files Browse the repository at this point in the history
…me.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
  • Loading branch information
spacedmonkey committed Mar 30, 2023
1 parent 2da4542 commit dd5f6c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit dd5f6c7

Please sign in to comment.