Pre-set CSS class into custom block/template

I am trying & learning to build custom block/template for Gutenberg and would like to “pre-set” CSS class for some specific block. Is it possible to add it like below? Refer: [Template and Block][1] For example, defined CSS class for one of the heading blockHeadStyle: function myplugin_register_book_post_type() { $args = array( ‘public’ => true, ‘label’ … Read more

Where on Github, or elsewhere, can I find the code for core-blocks?

Apparently, at one time, there was a directory of core-blocks for building Gutenberg templates on GitHub, but I’m not finding it anywhere. I talking about core/paragraph, etc. array( ‘core/paragraph’, array( ‘placeholder’ => ‘Content goes here’, ) ), array( ‘core/image’, array( … Thanks! 1 Answer 1 The core blocks appear to be defined in the Gutenberg … Read more

Why is my Gutenberg block returning an error after initial save?

I created a Gutenberg block but after saving it and going back into the post I receive this error: This block contains unexpected or invalid content I couldn’t find any inconsistencies and I had a friend also take a look over to see if there was anything amiss. What am I doing wrong? registerBlockType(‘myblog/check-list’, { … Read more

WordPress v5.0.3 Gutenberg & JS error “Uncaught SyntaxError: missing ) after argument list”

After update from WP 5.0.2 to 5.0.3 I had issues in wp-admin. I couldn’t edit post data. There was JS error “Uncaught SyntaxError: missing ) after argument list”, undefined “_” (lodash) etc. 3 Answers 3 The issue for me was the clean_script_tag() function from Soil. Removing add_filter(‘script_loader_tag’, ‘clean_script_tag’); solved the bug for me.

Gutenberg: How to mix dynamic and static output?

Gutenbergs handbook ( suggests to return null in the save() function for dynamic blocks. But what if I only want parts of my block to be dynamic and others to be static? Even if you save content statically in the save() function, it get’s completely overwritten by the dynamic content I am wondering how to … Read more