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
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user