plugin updates
This commit is contained in:
@@ -114,7 +114,7 @@ class WP_Block {
|
||||
* @since 5.5.0
|
||||
*
|
||||
* @param array $block {
|
||||
* A representative array of a single parsed block object. See WP_Block_Parser_Block.
|
||||
* An associative array of a single parsed block object. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @type array $attrs Attributes from block comment delimiters.
|
||||
@@ -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 ) {
|
||||
@@ -301,6 +310,15 @@ class WP_Block {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Adds the necessary context defined by the source.
|
||||
if ( ! empty( $block_binding_source->uses_context ) ) {
|
||||
foreach ( $block_binding_source->uses_context as $context_name ) {
|
||||
if ( array_key_exists( $context_name, $this->available_context ) ) {
|
||||
$this->context[ $context_name ] = $this->available_context[ $context_name ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$source_args = ! empty( $block_binding['args'] ) && is_array( $block_binding['args'] ) ? $block_binding['args'] : array();
|
||||
$source_value = $block_binding_source->get_value( $source_args, $this, $attribute_name );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user