Download the PHP package larsgowebdev/wp-battery-cli without Composer
On this page you can find all versions of the php package larsgowebdev/wp-battery-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download larsgowebdev/wp-battery-cli
More information about larsgowebdev/wp-battery-cli
Files in larsgowebdev/wp-battery-cli
Package wp-battery-cli
Short Description A WordPress CLI plugin for creating and managing WP-Battery components
License GPL-2.0-or-later
Informations about the package wp-battery-cli
WP-Battery CLI Plugin
A WordPress CLI plugin that provides commands for creating and managing WP-Battery theme components. This plugin extends WP-CLI to streamline the development workflow with WP-Battery themes.
Requirements
- PHP >= 8.1
- WordPress >= 6.5 (Composer-based), Bedrock recommended
- WP-CLI installed and configured
- WP-Battery theme framework installed
Installation
-
Install the plugin with composer:
-
Make sure the plugin is activated:
- Verify installation:
Available Commands
Initialize WP-Battery Structure
Creates the required folder structure for a WP-Battery theme.
Usage:
This creates the following structure in your theme:
Create Block
Creates a new block with required files and structure.
Required arguments:
- --name: Identifier of the block, it will be registered to that name and the folder structure will be named after it.
- --title: Name of the block, displayed in the WP admin area
Usage:
Creates:
Create Page Template
Creates a new page template with required files.
Required arguments:
- --name: Identifier of the page, the template will be named after it.
Usage:
Creates:
Create Menu Configuration
Creates a new menu configuration file.
Required arguments:
- --name: Identifier of the menu, the configuration file will be named after it
Usage:
Creates:
Create Options Page
Creates a new ACF options page configuration.
Required arguments:
- --name: Identifier of the options page, the configuration file will be named after it
Usage:
Creates:
Create Custom Post Type
Creates a custom post type configuration file to be automatically loaded by WP-Battery.
Required arguments:
- --name: Identifier of the post type, the configuration file will be named after it
- --namespace: Plugin/Theme namespace, for translations
Usage:
Creates:
Create Custom Taxonomy
Creates a custom taxonomy configuration file to be automatically loaded by WP-Battery.
Required arguments:
- --name: Identifier of the taxonomy, the configuration file will be named after it
- --namespace: Plugin/Theme namespace, for translations
- --post-type: Which post type this taxonomy will be registered for
- Note: Currently WP-Battery CLI only supports a single post type here. Of course, more can be added later.
Usage:
Creates:
Naming Conventions
All component names must follow these rules:
- Lowercase letters only
- Numbers allowed
- Hyphens and underscores allowed
- No spaces or special characters
- Cannot start or end with hyphen/underscore
- Cannot contain consecutive hyphens/underscores
Examples:
Renderer Functions
Both blocks and pages support custom render functions for data processing. These functions must:
- Contain the word 'render' in their name
- Accept one parameter ($context)
- Return the modified context
Example:
Safety Features
- Prevents overwriting existing components
- Validates component names before creation
- Provides helpful error messages and suggestions
- Creates .gitkeep files in empty directories
- Adds appropriate .gitignore rules
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
This project is licensed under the GPL-2.0 License.
All versions of wp-battery-cli with dependencies
roots/wordpress Version >= 6.6.1
larsgowebdev/wp-battery Version >=0.7.0 <1.0.0