Changeset 53268 for trunk/src/wp-includes/class-wp-block-type.php
- Timestamp:
- 04/26/2022 09:48:20 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-block-type.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-type.php
r53084 r53268 204 204 */ 205 205 public $style = null; 206 207 /** 208 * Attributes supported by every block. 209 * 210 * @since 6.0.0 211 * @var array 212 */ 213 const GLOBAL_ATTRIBUTES = array( 214 'lock' => array( 'type' => 'object' ), 215 ); 206 216 207 217 /** … … 356 366 $args['name'] = $this->name; 357 367 368 // Setup attributes if needed. 369 if ( ! isset( $args['attributes'] ) || ! is_array( $args['attributes'] ) ) { 370 $args['attributes'] = array(); 371 } 372 373 // Register core attributes. 374 foreach ( static::GLOBAL_ATTRIBUTES as $attr_key => $attr_schema ) { 375 if ( ! array_key_exists( $attr_key, $args['attributes'] ) ) { 376 $args['attributes'][ $attr_key ] = $attr_schema; 377 } 378 } 379 358 380 /** 359 381 * Filters the arguments for registering a block type.
Note: See TracChangeset
for help on using the changeset viewer.