WP-CLI

A command line interface for WordPress

Commands » scaffold

wp scaffold - Generate code for post types, taxonomies, plugins, child themes. etc.

Quick links: Github issues


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
_s Generate starter code for a theme based on _s.
child-theme Generate child theme based on an existing theme.
plugin Generate starter code for a plugin.
plugin-tests Generate files needed for running PHPUnit tests in a plugin.
post-type Generate PHP code for registering a custom post type.
taxonomy Generate PHP code for registering a custom taxonomy.
theme-tests Generate files needed for running PHPUnit tests in a theme.