mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Block bindings: Ensure block receives __default bindings when render.
Fixes an issue with the image block when using pattern overrides, where the image block with overrides enabled was not outputting all the expected image attributes. Ensures that the `process_block_bindings` method returns any updates to the block's binding metadata along with other computed attributes. Props talldanwp, cbravobernal, santosguillamot, mukesh27, gziolo. Fixes #62069. Built from https://develop.svn.wordpress.org/trunk@59095 git-svn-id: http://core.svn.wordpress.org/trunk@58491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e4a97f589
commit
23e8ce70f0
@ -237,6 +237,7 @@ class WP_Block {
|
||||
*
|
||||
* @since 6.5.0
|
||||
* @since 6.6.0 Handle the `__default` attribute for pattern overrides.
|
||||
* @since 6.7.0 Return any updated bindings metadata in the computed attributes.
|
||||
*
|
||||
* @return array The computed block attributes for the provided block bindings.
|
||||
*/
|
||||
@ -284,6 +285,14 @@ class WP_Block {
|
||||
: array( 'source' => 'core/pattern-overrides' );
|
||||
}
|
||||
$bindings = $updated_bindings;
|
||||
/*
|
||||
* Update the bindings metadata of the computed attributes.
|
||||
* This ensures the block receives the expanded __default binding metadata when it renders.
|
||||
*/
|
||||
$computed_attributes['metadata'] = array_merge(
|
||||
$parsed_block['attrs']['metadata'],
|
||||
array( 'bindings' => $bindings )
|
||||
);
|
||||
}
|
||||
|
||||
foreach ( $bindings as $attribute_name => $block_binding ) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.7-alpha-59094';
|
||||
$wp_version = '6.7-alpha-59095';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user