Block Registration: add SlotFill to extend a block's description #49887
Open
Description
- Primary issue: Block API #41236
- Discussion about this: Blocks: Deprecate non-string descriptions #44455 (comment)
What problem does this address?
It was previously possible to use React nodes in a block's description, like so:
description: (
<Fragment>
<p>
{ __(
'This block does something really fancy and complex.',
'my-fancy-complex-block'
) }
</p>
<p>
{ __( 'Here is a detailed description about the things my block does.', 'my-fancy-complex-block' ) }
</p>
<ExternalLink href={ supportLink }>{ __( 'Learn more about how to use me', 'my-fancy-complex-block' ) }</ExternalLink>
</Fragment>
),
This allowed adding extra information to a block's description, such as links to support documentation or more.
Unfortunately, this is no longer encouraged since #44455.
What is your proposed solution?
Instead of adding all that information to the block's description itself, and since adding it there can have some unintended side-effects, it would be nice to add a new SlotFill
that would be displayed right below the block's description in the editor sidebar, and nowhere else.
Metadata
Assignees
Labels
Type
Projects
Status
Todo