How to view all currently registered block patterns?

This looks like quite new functionality, the docs say ‘experimental’ and the first commit of this code to the WP repo was 6 days ago from date of this writing, so wouldn’t be surprised if you’ll have issues with what you’re doing related to it being in development. The class that manages block patterns is … Read more

How Do I Prevent An Image From Automatically Adjusting In Guttenberg Block Gallery?

Gutenberg is applying a flex-grow: 1; to the items, which allow it to fill the space. You override this by pasting the following into your css. .blocks-gallery-grid .blocks-gallery-image, .blocks-gallery-grid .blocks-gallery-item, .wp-block-gallery .blocks-gallery-image, .wp-block-gallery .blocks-gallery-item { flex-grow: 0; } Ideally, you do this in your theme, but if you urgently need this up, or if you … Read more

How to use __experimentalCaptureChildToolbar

https://github.com/WordPress/gutenberg/blob/2d7e6904cee90a92bf1fc60467d1c6bb03654656/packages/block-editor/src/components/inner-blocks/README.md#__experimentalcapturetoolbars Determines whether the toolbars of all child Blocks (applied deeply, recursive) should have their toolbars “captured” and shown on the Block which is consuming InnerBlocks. For example, a button block, deeply nested in several levels of block X that utilises this property will see the button block’s toolbar displayed on block X’s toolbar area. … Read more

Gutenberg : how can I get the title of the current block within its ‘edit’ function?

You can use wp.blocks.getBlockType() to get the block type’s settings. So if you’ve registered a block type with the name my-guten/foo-block, just run getBlockType( ‘my-guten/foo-block’ ) to get the block type’s title, icon, etc. const { registerBlockType, getBlockType } = wp.blocks; // Register a block type. registerBlockType( ‘my-guten/foo-block’, { … } ); // Get the … Read more

How do I disable the block marketplace for Editors?

The block directory is already disabled for editors. In order to use the block directory you must be logged in as a user that can install plugins. This would be administrators on single sites and super admins on multisites. Unless you have granted this ability to editors, they cannot use the block directory.

Add button to Block toolbar: toggleFormat is undefined

Now I can see what the problem is. You are not using the onChange properly. It comes from the props of the edit component: Here you have a complete example that works: registerFormatType( ‘nelio/keyboard’, { title: __( ‘Key’, ‘nelio’ ), tagName: ‘kbd’, className: null, edit: ( { value, onChange } ) => ( <RichTextToolbarButton icon=”editor-removeformatting” … Read more