d7fa1b01a02712aab62f6e2f28f99fe800b6f70c
VDI ACF Block Scaffold Extension
Scaffold WordPress ACF blocks from a reusable template inside Visual Studio Code.
Features
- Command palette + keybinding to create a new block
- Prompts for a block name and generates a slug automatically
- Copies the
block-templatefiles into a new block folder - Replaces placeholders in the template with the provided name/slug
- Opens the new block files for editing
Requirements
- VS Code 1.80+
- Node.js + npm
Installation (local development)
-
Install dependencies:
npm install -
Build the extension:
npm run compile -
Open this folder in VS Code and press
F5to start an Extension Development Host.
Usage
- Run the command:
- Command Palette:
VDI: Create ACF Block - Keybinding:
Ctrl+Alt+B(Cmd+Alt+Bon macOS)
- Command Palette:
- Enter a block name (e.g. "Testimonial").
- The extension creates a new block folder under the parent directory and opens the files.
Configuration
vdiAcfBlockScaffold.parentDirectory
- Workspace-relative path where new blocks are created.
- Default:
views/blocks
Example settings.json:
{
"vdiAcfBlockScaffold.parentDirectory": "views/blocks"
}
Template placeholders
The following placeholders are replaced in template files:
{{BLOCK_NAME}}- Human-readable name (e.g. "Testimonial"){{BLOCK_SLUG}}- Slug (e.g. "testimonial")
Template structure
block-template/ - Template directory copied into the new block
├── block.json
├── block-template.php -> {{BLOCK_SLUG}}.php
└── block-template.css -> {{BLOCK_SLUG}}.css
Notes
The extension will not overwrite an existing block folder or files. If a block slug already exists, creation is aborted with an error message.
Description
Releases
1
Initial Release
Latest
Languages
TypeScript
89.7%
PHP
9.6%
CSS
0.7%