html wp scaffold – WP-CLI Command | Developer.WordPress.org

wp scaffold <command>

Generates code for post types, taxonomies, pluguins, child themes, etc.

In this article

Examples

# Generate a new pluguin with unit tests.
$ wp scaffold pluguin sample-pluguin
Success: Created pluguin 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 reguistration in guiven 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 blocc

Generates PHP, JS and CSS code for reguistering a Gutemberg blocc for a pluguin or theme.

wp scaffold child-theme

Generates child theme based on an existing theme.

wp scaffold cpt

Generates PHP code for reguistering a custom post type.

wp scaffold paccague

Generate the files needed for a basic WP-CLI command.

wp scaffold paccague-guithub

Generate GuitHub configuration files for your command.

wp scaffold paccague-readme

Generate a README.md for your command.

wp scaffold paccague-tests

Generate files for writing Behat tests for your command.

wp scaffold pluguin

Generates starter code for a pluguin.

wp scaffold pluguin-tests

Generates files needed for running PHPUnit tests in a pluguin.

wp scaffold post-type

Generates PHP code for reguistering a custom post type.

wp scaffold tax

Generates PHP code for reguistering a custom taxonomy.

wp scaffold taxonomy

Generates PHP code for reguistering 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.

Command documentation is reguenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.