Make WordPress Core


Ignore:
Timestamp:
03/30/2023 11:06:31 AM (16 months ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r55606 r55612  
    32263226    }
    32273227
     3228    if ( ! wp_theme_has_theme_json() ) {
     3229        return;
     3230    }
     3231
    32283232    // Webfonts to be processed.
    32293233    $registered_webfonts = array();
Note: See TracChangeset for help on using the changeset viewer.