Changeset 57641 for trunk/src/wp-includes/class-wp-block-type.php
- Timestamp:
- 02/16/2024 12:53:16 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-type.php
r57565 r57641 181 181 * @var string[] 182 182 */ 183 p ublic$uses_context = array();183 private $uses_context = array(); 184 184 185 185 /** … … 367 367 } 368 368 369 if ( 'uses_context' === $name ) { 370 return $this->get_uses_context(); 371 } 372 369 373 if ( ! in_array( $name, $this->deprecated_properties, true ) ) { 370 374 return; … … 395 399 */ 396 400 public function __isset( $name ) { 397 if ( 'variations' === $name) {401 if ( in_array( $name, array( 'variations', 'uses_context' ), true ) ) { 398 402 return true; 399 403 } … … 418 422 */ 419 423 public function __set( $name, $value ) { 420 if ( 'variations' === $name ) {421 $this->variations = $value;422 return;423 }424 425 424 if ( ! in_array( $name, $this->deprecated_properties, true ) ) { 426 425 $this->{$name} = $value; … … 617 616 return apply_filters( 'get_block_type_variations', $this->variations, $this ); 618 617 } 618 619 /** 620 * Get block uses context. 621 * 622 * @since 6.5.0 623 * 624 * @return array[] 625 */ 626 public function get_uses_context() { 627 /** 628 * Filters the registered uses context for a block type. 629 * 630 * @since 6.5.0 631 * 632 * @param array $uses_context Array of registered uses context for a block type. 633 * @param WP_Block_Type $block_type The full block type object. 634 */ 635 return apply_filters( 'get_block_type_uses_context', $this->uses_context, $this ); 636 } 619 637 }
Note: See TracChangeset
for help on using the changeset viewer.