You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add the ability to scope RichTextFormats to specific blocks / tagNames #46551
Currently, when a rich text format gets registered it shows up for every block / rich text area available.
Individual RichText components can specify a manual allowedFormats list or specify that there shouldn't be any interactive formats applied to the element withoutInteractiveFormatting.
But this cannot get modified on the Format level. So it for example is not possible to remove a specific format option from the caption element. Or the heading block.
Possible Solutions
It would be great to be able to configure at the Fomat level which blocks / which tag names the format should show up for and or which it should not show up for. So an allow / deny list for the supported blocks / tagNames
Activity
fabiankaegy commentedon Apr 21, 2024
Actually as @2ndkauboy pointed out to me on Twitter limiting a rich text format to only a certain type of block is already possible and even documented in the getting started guide here: https://developer.wordpress.org/block-editor/how-to-guides/format-api/#step-4-show-the-button-only-for-specific-blocks-optional
Closing this issue 🎉