[wp-trac] [WordPress Trac] #57583: Add support for editing block style variations in the global styles

WordPress Trac noreply at wordpress.org
Tue Feb 7 00:17:23 UTC 2023


#57583: Add support for editing block style variations in the global styles
-------------------------------------------------+-------------------------
 Reporter:  isabel_brison                        |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.2
Component:  Editor                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch gutenberg-merge has-       |     Focuses:
  testing-info has-unit-tests commit             |
-------------------------------------------------+-------------------------

Comment (by isabel_brison):

 The `styles` property of `WP_Block_Type` should always be an array:
 https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes
 /class-wp-block-type.php#L269 but I'm not sure there are any safeguards
 against registering it as something else. It's always an array in core
 blocks, at least (I tried printing `$block_type->styles` just before that
 line and only arrays are output)

 I guess it won't hurt to check if it's an array before going into the
 `foreach` though.

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


More information about the wp-trac mailing list