- Enter the plugin folder, and run
npx @wordpress/create-block [options] {block-name}
Options:
-t, --template <name> block template type name, allowed values: "es5", "esnext", or the name of an external npm package (default: "esnext")
--namespace <value> internal namespace for the block name (cannot has number or special characters)
--category <name> category name for the block
Examples:
$ npx @wordpress/create-block --template es5
// use es5 language (direct javascript file)
$ npx @wordpress/create-block --template esnext
// use esnext language (need to run npm build, has src and build directories)
npx @wordpress/create-block --namespace st_quiz --category quizzes starter-block