How do i remove some of the buttons in from a block toolbar in the gutenberg editor?
I thought there was a similar api to removing blocks for the paragraph block, something like but there is 0 documentation on how to remove this stuff:
wp.domReady( () => {
// wp.data.select( 'core/rich-text' ).getFormatTypes()
// ^ tried with 'core/image' but throws an error
wp.richText.unregisterFormatType( 'core/image' );
wp.richText.unregisterFormatType( 'core/strikethrough' );
wp.richText.unregisterFormatType( 'core/keyboard' );
wp.richText.unregisterFormatType( 'core/text-color' );
wp.richText.unregisterFormatType( 'core/code' );
});
display:none
would be enough to solve the issue but these buttons don't have a selector which doesn't cause issues with other toolbars it seems.img
tag, the image tag has seen numerous UI changes since it was introduced with things moving around ( wp 5.8/GB V10.3 does a lot of this ), e.g. alignment used too be 3 buttons and now it's a dropdown menu