Skip to content

Commit

Permalink
Block bindings: Ensure the block receives the fully expanded __defaul…
Browse files Browse the repository at this point in the history
…t bindings when rendering.
  • Loading branch information
talldan committed Sep 18, 2024
1 parent d8e0544 commit 11c72a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wp-includes/class-wp-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ private function process_block_bindings() {
}
}

// Update the bindings in the computed attributes.
// This ensures the block receives the expanded __default binding when it renders.
$computed_attributes['metadata'] = array_merge(
$parsed_block['attrs']['metadata'],
array( 'bindings' => $bindings )
);

return $computed_attributes;
}

Expand Down

0 comments on commit 11c72a7

Please sign in to comment.