The Block Editor: Disable “Color settings” in the specific block
The Block Editor: Disable “Color settings” in the specific block
The Block Editor: Disable “Color settings” in the specific block
Remove left alignment option in core/image block
I’ve modified serialize_block a bit: function serialize_block_template( $block ) { $block_content=””; if (isset($block[2])) { $index = 0; foreach ( $block[2] as $chunk ) { $block_content .= is_string( $chunk ) ? $chunk : serialize_block_template( $block[2][ $index++ ] ); } } return get_comment_delimited_block_content( $block[0], $block[1], $block_content ); } Disclaimer: could have some bugs, only tested it for … Read more
Using Primary Color in Plugin Block
Is there a core Sortable component in Gutenberg?
How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
Actually an assumption I made in the question was wrong; The update button doesn’t only change when the output of the save function changes. It also changes when the attributes are changed. However I found a small bug, which you can’t really see it in the provided code. In my BlockSettings component I was using … Read more
The meta value is read when the block loads and assigned to the block attribute. Changes to the block will update the attribute and when the post saves the value will save to the meta. So, as far as I understood, there is no need to actually save anything in the registerBlockType js function. The … Read more
Very similar to your goal, I recently wanted to add a block-style to all existing blocks. I found that upon loading an editor page, I must wait for the WP editor JS data to populate before adding my styles, and AFAIK, there’s no callback hook for this. So I chose to add a not-so-elegant delay … Read more
The handle() method is being called by an add_action(‘enqueue_block_editor_assets, [$block, ‘handle’]) method along with all the other blocks. Here lies the problem. The register_block_type is being called too late. Try to call the function inside the init action hook. You can see an example in the shortcode block of the core.