- Clone the Git directory into your plugins folder.
cd
into the plugin directory, and runnpm install
.- Run
npm run start
for development mode, ornpm run build
for a development build.
cd
into thesrc
directory.- Run
npx @wordpress/create-block --no-plugin
.- The template variant to use for this block:
dynamic
. - The internal namespace for the block name:
north-commerce
.
- The template variant to use for this block:
cd
into the new block directory insrc
.- Create
block.php
file. - Add a call to
register_block_type_from_metadata
:function north_commerce_blocks_register_<blog-slug>_block() { register_block_type( NORTH_COMMERCE_BLOCKS_PLUGIN_DIR_PATH . 'build/<blog-slug>/'); } add_action( 'init', 'north_commerce_blocks_register_<blog-slug>_block' );