[wp-trac] [WordPress Trac] #61154: Fix the 'attributes' dynamic property in WP_Block

WordPress Trac noreply at wordpress.org
Mon May 6 19:22:40 UTC 2024


#61154: Fix the 'attributes' dynamic property in WP_Block
-------------------------------+------------------------------------------
 Reporter:  antonvlasenko      |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Editor             |    Version:  trunk
 Severity:  normal             |   Keywords:  needs-patch needs-unit-tests
  Focuses:  php-compatibility  |
-------------------------------+------------------------------------------
 The `WP_Block` class employs the `__get` magic method to compute the
 `attributes` class property.
 However, since PHP 8.2 does not support dynamic properties, it is better
 to eliminate this approach and explicitly declare the
 `WP_Block::$attributes` class property to store the block's attributes
 instead.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61154>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list