Opened 3 years ago
Last modified 16 months ago
#58432 new defect (bug)
BUG: Custom Core Block Variation details not updated in "Settings Sidebar" section
| Reported by: | deepakvijayan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Editor | Version: | |
| Severity: | major | Keywords: | has-test-info has-screenshots |
| Cc: | Focuses: | javascript |
Description
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:
- 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' );
- 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: '' } ],
]
}
);
- Check inside editor for new core block variation.
- 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/
Attachments (2)
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thank you for the detailed report, @deepakvijayan!
As this deals with the Editor component, it is suggested to file this as a Gutenberg issue. Either you or another contributor can do this.
Once filed in Gutenberg, please cross-link this ticket and the GB issue so that contributors can easily trace the history. Thanks!