Make WordPress Core

Changeset 58428

Timestamp:
06/18/2024 06:00:51 AM (7 weeks ago)
Author:
isabel_brison
Message:

Editor: Read theme.json files stored in styles/ folder only once.

Uses read_json_file to access cached file if it exists instead of using wp_json_file_decode directly.

Props oandregal, aaronrobertshaw, joemcgill, ramonopoly, isabel_brison.
See #61451.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json-resolver.php

    r58409 r58428  
    726726     *              theme.json partial files by the scope to which they
    727727     *              can be applied e.g. theme vs block etc.
     728
    728729     *
    729730     * @param string $scope The scope or type of style variation to retrieve e.g. theme, block etc.
     
    752753        ksort( $variation_files );
    753754        foreach ( $variation_files as $path => $file ) {
    754             $decoded_file = wp_json_file_decode( $path, array( 'associative' => true ) );
     755            $decoded_file = );
    755756            if ( is_array( $decoded_file ) && static::style_variation_has_scope( $decoded_file, $scope ) ) {
    756757                $translated = static::translate( $decoded_file, wp_get_theme()->get( 'TextDomain' ) );
Note: See TracChangeset for help on using the changeset viewer.