Do not wrap custom block in an additional DIV but instead use only the JSX I provide

Update: WordPress 5.6 will be released soon and this will include a block API version 2 which allows all these modifications noted in OP. https://make.wordpress.org/core/2020/11/18/block-api-version-2/ I found a filter that allows me to modify the wrapper. Still, I can’t change the HTML tag, but it’s better than nothing. const { createHigherOrderComponent } = wp.compose; const … Read more

Blocks. How to store default settings?

As Tom mentioned, you can use Templates, which allows you to define a preset of blocks that are available by default in your post whenever you try to create a new post: https://developer.wordpress.org/block-editor/developers/block-api/block-templates/ If you aren’t ready to get your hands dirty with code, you can also use Justin Tadlock’s Block Pattern Builder plugin to … Read more

Create a trailing block with programatically generated Gutenberg columns

I’ve currently “solved” this by backfilling with empty divs: $array_chunks = array_chunk($array_of_posts, 3); foreach($array_chunks as $posts) { echo ‘<div class=”wp-block-columns”>’; foreach($posts as $post) { echo ‘<div class=”wp-block-column”>’; // entry echo ‘</div>’; for ($i = 0; $i < ( 3 – count($posts)); $i++) { echo ‘<div class=”wp-block-column”>’; echo ‘</div>’; } } echo ‘</div>’; } But that … Read more