wp scaffold taxonomy

Generates PHP code for registering a custom taxonomy.

Synopsis

bash
wp scaffold taxonomy <slug> [--post_types=<post-types>] [--label=<label>] [--textdomain=<textdomain>] [--theme] [--plugin=<plugin>] [--raw] [--force]

Options

The internal name of the taxonomy.

[–post_types=] Post types to register for use with the taxonomy.

[–label= The text used to translate the update messages.

[–textdomain=] The textdomain to use for the labels.

[–theme] Create a file in the active theme directory, instead of sending to STDOUT. Specify a theme with --theme=<theme> to have the file placed in that theme.

[–plugin=] Create a file in the given plugin’s directory, instead of sending to STDOUT.

[–raw] Just generate the register_taxonomy() call and nothing else.

[–force] Overwrite files that already exist.

Examples

bash
# Generate PHP code for registering a custom taxonomy and save in a file
$ wp scaffold taxonomy venue --post_types=event,presentation > taxonomy.php