Genesis Custom Blocks is designed to be a replacement for the Block Lab plugin. Using Block Lab’s built in migration workflows, the vast majority of users will be able to transition to Genesis Custom Blocks without needing to make any manual changes.
However, if you’re creating custom blocks using Block Lab’s PHP API, specifically the block_lab_add_block or block_lab_add_field functions, you will need to update your code with new Genesis Custom Blocks function names.
The following changes are required:
- Rename them block_lab_add_block() to add_block()
- Rename them block_lab_add_field() to add_field()
- Add a use statement to the top of your PHP file for each function
For example:
block_lab_add_block( $block_name, $block_config );
Will become:
use function Genesis\CustomBlocks\add_block; add_block( $block_name, $block_config );
More information about namespacing and use statements is available in the PHP documentation.
