[wp-trac] [WordPress Trac] #58432: BUG: Custom Core Block Variation details not updated in "Settings Sidebar" section

WordPress Trac noreply at wordpress.org
Wed May 31 06:10:31 UTC 2023


#58432: BUG: Custom Core Block Variation details not updated in "Settings Sidebar"
section
---------------------------+-----------------------------
 Reporter:  deepakvijayan  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Editor         |    Version:
 Severity:  major          |   Keywords:
  Focuses:  javascript     |
---------------------------+-----------------------------
 **Issue:**

 When adding a custom **core block variation**, the details ( title, icon,
 description ) are not updated in the **"Settings Sidebar"** section. Hence
 there is no way to distinguish between custom core block **variations**
 and core **blocks** once a block is added.

 **How to reproduce:**

 1. Add support for block variations to your existing theme.

 {{{

 function prefix_editor_assets() {
         wp_enqueue_script(
                 'prefix-block-variations',
                 get_template_directory_uri() . '/assets/js/blocks/block-
 variations.js',
                 array( 'wp-blocks' )
         );
 }
 add_action( 'enqueue_block_editor_assets', 'prefix_editor_assets' );

 }}}


 2. Create a custom **core block variation**


 {{{
 wp.blocks.registerBlockVariation(
         'core/group',
         {
             name: 'card-group',
             title: 'Card group',
             description: 'A group with card styling',
             label: 'Card group',
             icon: 'wordpress',
             attributes: {
                className: 'card-group',
             },
             innerBlocks: [
                 [ 'core/heading', { content: '' } ],
                 [ 'core/paragraph', { content: '' } ],
             ]
         }
 );

 }}}

 3. Check inside editor for new core block variation.

 4. Add new core block variation and check the siderbar with the block
 selected.

 Attaching pic & screen recording of the issue as well.


 Note: I used the following tutorial by **Carolina Nymark** to create the
 variation
 https://fullsiteediting.com/lessons/block-variations/

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


More information about the wp-trac mailing list