Changeset 58289 for trunk/src/wp-includes/class-wp-block.php
- Timestamp:
- 06/03/2024 07:42:57 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block.php
r58234 r58289 237 237 * 238 238 * @since 6.5.0 239 * @since 6.6.0 Handle the `__default` attribute for pattern overrides. 239 240 * 240 241 * @return array The computed block attributes for the provided block bindings. … … 260 261 } 261 262 262 foreach ( $parsed_block['attrs']['metadata']['bindings'] as $attribute_name => $block_binding ) { 263 $bindings = $parsed_block['attrs']['metadata']['bindings']; 264 265 /* 266 * If the default binding is set for pattern overrides, replace it 267 * with a pattern override binding for all supported attributes. 268 */ 269 if ( 270 isset( $bindings['__default']['source'] ) && 271 'core/pattern-overrides' === $bindings['__default']['source'] 272 ) { 273 $updated_bindings = array(); 274 275 /* 276 * Build a binding array of all supported attributes. 277 * Note that this also omits the `__default` attribute from the 278 * resulting array. 279 */ 280 foreach ( $supported_block_attributes[ $parsed_block['blockName'] ] as $attribute_name ) { 281 // Retain any non-pattern override bindings that might be present. 282 $updated_bindings[ $attribute_name ] = isset( $bindings[ $attribute_name ] ) 283 ? $bindings[ $attribute_name ] 284 : array( 'source' => 'core/pattern-overrides' ); 285 } 286 $bindings = $updated_bindings; 287 } 288 289 foreach ( $bindings as $attribute_name => $block_binding ) { 263 290 // If the attribute is not in the supported list, process next attribute. 264 291 if ( ! in_array( $attribute_name, $supported_block_attributes[ $this->name ], true ) ) { … … 414 441 * the rendered HTML of all its inner blocks, including any interactive block. 415 442 */ 416 static $root_interactive_block 443 static $root_interactive_block = null; 417 444 /** 418 445 * Filters whether Interactivity API should process directives.
Note: See TracChangeset
for help on using the changeset viewer.