[wp-trac] [WordPress Trac] #53006: Blocks: Add isDefault to server side block styles registry

WordPress Trac noreply at wordpress.org
Tue Apr 13 07:47:39 UTC 2021


#53006: Blocks: Add isDefault to server side block styles registry
-------------------------+---------------------
 Reporter:  gziolo       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.8
Component:  General      |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+---------------------

Comment (by gziolo):

 This will require additional changes in https://developer.wordpress.org
 /block-editor/reference-guides/filters/block-filters/.

 Given that I see `inline_style` and `style_handle` fields that use snake
 case, I'm leaning towards `is_default`.

 I tested with


 {{{
 register_block_style(
     'core/list',
     array(
         'name'         => 'green-list',
         'label'        => __( 'Green List' ),
     )
 );
 register_block_style(
     'core/list',
     array(
         'name'         => 'blue-list',
         'label'        => __( 'Blue List' ),
         'is_default'   => true,
     )
 );
 }}}

 I can confirm that it correctly applies changes with the example used.

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


More information about the wp-trac mailing list