registerBlockType: Building Gutenberg Blocks For WordPress
Here in this blog i’m going to make you learn and understand “registerBlockType()” function through a brief video from Zac Gordon and this function will be used to register your custom block and it’s made available in global scope.
registerBlockType() function accepts two parameters:
- Block name – This is a string containing the name of our custom block with a namespace prefix. For example: my-plugin/my-custom-block.
- Block settings – This is an object that handles everything else about our custom block.
Block Settings
In registerBlockType() Zac Gordon will guide you through all the setting that matters to creating your custom block. He’ll start defining all the 9 setting types in the below video. These settings help identify our block within the editor and define where it should be found.
Apart from the above brief video you can get access to more of Zac Gordon‘s resource where you can explore more on this new WordPress editor named “Gutenberg“.
Comments
No comment yet.