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.
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.