How to remove buttons from gutenberg toolbar

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' );
});

enter image description here

0

Leave a Comment