JavaScript for WordPress Forums Gutenberg Development Fatal error due to the register_block_type Reply To: Fatal error due to the register_block_type

#40008
mikemcalister
Participant

Thanks for pinging the #editor-js channel! Someone came through with a suggestion to hook your block loading to the init action, as seen below. This has removed the register_block_type error!

function load_your_blocks() {
	/**
	 * Initialize the blocks
	 */
	require_once plugin_dir_path( __FILE__ ) . 'src/init.php';
}
add_action( 'init', 'load_your_blocks' );