Skip to content

Commit

Permalink
Merge registry updates with old values
Browse files Browse the repository at this point in the history
  • Loading branch information
mboynes authored Dec 12, 2024
1 parent c903946 commit 19ad750
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Blocks/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function ($arr, $block_type) {
}

public static function update_registry( $registry ) {
// Merge the new registry with the old registry. This will ensure that we don't remove any blocks that were
// available in another context (e.g. another post type) but not this one.
$old_values = get_option( WP_GRAPHQL_GUTENBERG_REGISTRY_OPTION_NAME ) ?? [];
return update_option( WP_GRAPHQL_GUTENBERG_REGISTRY_OPTION_NAME, $registry, false );
}

Expand Down

0 comments on commit 19ad750

Please sign in to comment.