Skip to content

Commit

Permalink
Validate block registration for merged data
Browse files Browse the repository at this point in the history
  • Loading branch information
joemcgill committed Aug 18, 2023
1 parent b9cd9c8 commit d1319a1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,18 @@ public static function get_merged_data( $origin = 'custom' ) {
$origin = 'custom';
}

if ( null !== static::$merged[ $origin ] ) {
// Map origins to block cache values.
$cache_map = array(
'default' => 'core',
'blocks' => 'blocks',
'theme' => 'theme',
'custom' => 'user',
);

if (
null !== static::$merged[ $origin ]
&& static::has_same_registered_blocks( $cache_map[ $origin ] )
) {
return static::$merged[ $origin ];
}

Expand Down

0 comments on commit d1319a1

Please sign in to comment.