[wp-trac] [WordPress Trac] #52592: PHP warning when the label property is missing from register_block_style

WordPress Trac noreply at wordpress.org
Tue Feb 4 08:40:55 UTC 2025


#52592: PHP warning when the label property is missing from register_block_style
-------------------------------------------------+-------------------------
 Reporter:  poena                                |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.8
Component:  Editor                               |     Version:  5.3
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by audrasjb):

 * owner:  (none) => audrasjb
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"59760" 59760]:
 {{{
 #!CommitTicketReference repository="" revision="59760"
 Editor: Add a fallback to `WP_Block_Styles_Registry` if the label is
 missing.

 Both `name` and `label` properties are required when registering a block
 style. If the label is missing, assign `name` as the value for the
 `label`, to ensure the property is defined. This avoids a PHP warning in
 such case.

 Props poena, Rahmohn, aaronrobertshaw, audrasjb, rinkalpagdar.
 Fixes #52592.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52592#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list