This file contains all the configuration required for a block to work. It's used in WordPress
registerBlockType method to register a block. Using
"description" : "Heading block with custom settings.",
Most of the keys are the same as
registerBlockType method, but we also have some custom attributes here:
Attributes key is an object of attributes that you define and where you set up default values for a block. These attributes are then provided for you in the editor as props, and the PHP view part in the
We are using the same structure as described in Block Editor documentation.
hasInnerBlocks key is set to true, blocks
save method for inner blocks will be used. This method is used if the block has
InnerBlocks. In PHP you now have
$inner_block_content variable available. Here is an example of what happens in the back:
save = () => createElement(InnerBlocks.Content);
hasWrapper key is set to false, blocks PHP render method will not be passed to the wrapper component.