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

WordPress Trac noreply at wordpress.org
Wed Jul 10 08:20:50 UTC 2024


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

 * keywords:  has-patch => has-patch needs-testing


Comment:

 Testing instructions for PR #7008:

 Enabling displaying or logging of PHP errors/warnings/notices.
 Add the following code inside twentytwentyfour_block_styles() in
 functions.php of the theme Twenty Twenty-Four:
 {{{
 register_block_style(
     'core/quote',
     array(
         'name'  => 'test',
         'inline_style' => '.wp-block-quote.is-style-blue-quote { color:
 blue; }',
     )
 );
 }}}

 The notice added in the PR should be present on the front and the admin
 area, but you may need to refresh the page first.

 {{{
 Notice: Function WP_Block_Styles_Registry::register was called
 incorrectly. Block style label must be a string. Please see Debugging in
 WordPress for more information. (This message was added in version 6.7.0.)
 in /var/www/src/wp-includes/functions.php on line 6085
 }}}

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


More information about the wp-trac mailing list