Examples
# Generate a new plugin with unit tests.
$ wp scaffold plugin sample-plugin
Success: Created plugin files.
Success: Created test files.
# Generate theme based on _s.
$ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe"
Success: Created theme 'Sample Theme'.
# Generate code for post type registration in given theme.
$ wp scaffold post-type movie --label=Movie --theme=simple-life
Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.
Subcommands
Name | Description |
---|---|
wp scaffold block | Generates PHP, JS and CSS code for registering a Gutenberg block for a plugin or theme. |
wp scaffold child-theme | Generates child theme based on an existing theme. |
wp scaffold package | Generate the files needed for a basic WP-CLI command. |
wp scaffold package-github | Generate GitHub configuration files for your command. |
wp scaffold package-readme | Generate a README.md for your command. |
wp scaffold package-tests | Generate files for writing Behat tests for your command. |
wp scaffold plugin | Generates starter code for a plugin. |
wp scaffold plugin-tests | Generates files needed for running PHPUnit tests in a plugin. |
wp scaffold post-type | Generates PHP code for registering a custom post type. |
wp scaffold taxonomy | Generates PHP code for registering a custom taxonomy. |
wp scaffold theme-tests | Generates files needed for running PHPUnit tests in a theme. |
wp scaffold underscores | Generates starter code for a theme based on _s. |
wp scaffold _s | Generates starter code for a theme based on _s. |