serverSideRender does not render “preview” html inside Gutenberg block

Ok, after spending the whole day searching and reading I found the solution. It seems that ServerSideRender should be de-structured from wp.components and NOT from wp.serverSideRender After replacing const { serverSiderRender: ServerSideRender } = wp.serverSideRender; with const { ServerSideRender } = wp.components; And // <serverSideRender <ServerSideRender block=”gutenberg-examples/example-dynamic” attributes={ props.attributes } /> All works fine now … Read more

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