Changeset 57641 for trunk/src/wp-includes/class-wp-block.php
- Timestamp:
- 02/16/2024 12:53:16 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-block.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block.php
r57576 r57641 232 232 */ 233 233 private function process_block_bindings() { 234 $parsed_block = $this->parsed_block; 235 236 $computed_attributes = array(); 237 238 // Allowed blocks that support block bindings. 239 // TODO: Look for a mechanism to opt-in for this. Maybe adding a property to block attributes? 240 $allowed_blocks = array( 234 $parsed_block = $this->parsed_block; 235 $computed_attributes = array(); 236 $supported_block_attributes = array( 241 237 'core/paragraph' => array( 'content' ), 242 238 'core/heading' => array( 'content' ), … … 245 241 ); 246 242 247 // If the block doesn't have the bindings property, isn't one of the allowed243 // If the block doesn't have the bindings property, isn't one of the supported 248 244 // block types, or the bindings property is not an array, return the block content. 249 245 if ( 250 ! isset( $ allowed_blocks[ $this->name ] ) ||246 ! isset( $supported_block_attributes[ $this->name ] ) || 251 247 empty( $parsed_block['attrs']['metadata']['bindings'] ) || 252 248 ! is_array( $parsed_block['attrs']['metadata']['bindings'] ) … … 256 252 257 253 foreach ( $parsed_block['attrs']['metadata']['bindings'] as $attribute_name => $block_binding ) { 258 // If the attribute is not in the allowed list, process next attribute.259 if ( ! in_array( $attribute_name, $ allowed_blocks[ $this->name ], true ) ) {254 // If the attribute is not in the supported list, process next attribute. 255 if ( ! in_array( $attribute_name, $supported_block_attributes[ $this->name ], true ) ) { 260 256 continue; 261 257 }
Note: See TracChangeset
for help on using the changeset viewer.