<?php

function create_block_question_selector_block_init() {
	register_block_type( __DIR__ . '/build' );
}
add_action( 'init', 'create_block_question_selector_block_init' );

This snippet was auto-generated by using the Create Block NPM package available from WordPress by running the CLI command:

npx @wordpress/create-block [options] [slug]

It utilizes register_block_type() and defines the build directory as the single argument. WP expects this directory to have a block.json file, which is also created automatically by the Create Block NPM package.

View All