Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ private static function style_variation_has_scope( $variation, $scope ) {
* @since 6.6.0 Added configurable scope parameter to allow filtering
* theme.json partial files by the scope to which they
* can be applied e.g. theme vs block etc.
* Added basic caching for read theme.json partial files.
*
* @param string $scope The scope or type of style variation to retrieve e.g. theme, block etc.
* @return array
Expand All @@ -751,7 +752,7 @@ public static function get_style_variations( $scope = 'theme' ) {
}
ksort( $variation_files );
foreach ( $variation_files as $path => $file ) {
$decoded_file = wp_json_file_decode( $path, array( 'associative' => true ) );
$decoded_file = self::read_json_file( $path );
if ( is_array( $decoded_file ) && static::style_variation_has_scope( $decoded_file, $scope ) ) {
$translated = static::translate( $decoded_file, wp_get_theme()->get( 'TextDomain' ) );
$variation = ( new WP_Theme_JSON( $translated ) )->get_raw_data();
Expand Down