Skip to content

basedonline/bp-create-block

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bp-create-block

A CLI tool for creating and managing ACF (Advanced Custom Fields) blocks with Twig templates.

How to run

npx bp-create-block

Commands

Create Block (Default)

Creates a new ACF block with Twig template.

npx bp-create-block create
# or simply
npx bp-create-block

Interactive prompts:

  • Block slug
  • Block title (defaults to formatted slug)
  • Block description
  • Block category
  • Dashicon (without prefix)
  • Keywords (comma-separated)
  • Post type restrictions (optional)
  • Full alignment support (y/n)

Migrate Blocks

Migrates blocks from v1 to v2 structure.

npx bp-create-block migrate

Automatically updates:

  • Moves blocks folder to theme root
  • Updates example folder structure
  • Modifies functions.php
  • Converts block structure to v2 format

Reuse Block

Copies an existing block for reuse and customization.

npx bp-create-block reuse

Requirements:

  • Must be run from blocks folder
  • Prompts for source block path
  • Option to rename the copied block

Update ACF Version

Updates blocks from ACF version 2 to version 3.

npx bp-create-block v2-to-v3

Automatically updates blockVersion to 3 in all block.json files.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published