style.css carrying the theme headers. On a terminal, anything you leave out is asked for by a short wizard; with --no-interaction (-n), nothing is asked.
Usage
Arguments
string
Name of the theme. Asked for when it is missing; with
--no-interaction, a missing name fails with exit code 2.string
Folder name and slug of the theme. Always normalized to a slug (
my_theme becomes my-theme); when omitted, it is derived from the name.Options
The options allow you to set the information in your theme’s header (see the WordPress documentation).string
default:"1.0.0"
Version theme header
string
Author theme header
string
Author URI theme header
string
Theme URI theme header
string
Description theme header
string
Requires at least theme header
string
Requires PHP theme header
string
License theme header
string
License URI theme header
string
Text Domain theme header
string
Domain Path theme header
string
Tags theme header
Interactive mode
On a terminal,wpc theme init opens a wizard:
- Theme name, unless you passed it.
- Headers to edit: a checklist of the optional headers. The ones that already have a value are ticked: the options you passed,
Version(1.0.0) and the author details known to your organization (Author,Author URI). - One question per ticked header, pre-filled with its current value.
The registry refuses to publish a theme without an
Author header. If your
organization has no author details, or wpc has no API key to look them up,
pass --author yourself.--no-interaction, the same defaults fill in the headers you did not pass, without asking.
Outside a terminal (piped input, CI), or with --output=plain or WPC_NO_TUI=1, the same questions are asked line by line instead, after a Would you like to define theme additional headers ? [N/y] confirmation.
Examples
- Create a theme without any interaction
- Answer the questions line by line