Wp scaffold(WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

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

Volgens mij niet wat ik zoek (juli 2021 - klonen & vertalen van sites), want dit commando genereert code.

wp help scaffold

NAME

  wp scaffold

DESCRIPTION

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

SYNOPSIS

  wp scaffold <command>

SUBCOMMANDS

  block             Generates PHP, JS and CSS code for registering a Gutenberg block for a plugin or theme.
  child-theme       Generates child theme based on an existing theme.
  plugin            Generates starter code for a plugin.
  plugin-tests      Generates files needed for running PHPUnit tests in a plugin.
  post-type         Generates PHP code for registering a custom post type.
  taxonomy          Generates PHP code for registering a custom taxonomy.
  theme-tests       Generates files needed for running PHPUnit tests in a theme.
  underscores       Generates starter code for a theme based on _s.

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

wp scaffold block

wp scaffold child-theme

wp scaffold plugin

wp scaffold plugin-tests

wp scaffold taxonomy

Create custom taxonomies

wp help scaffold taxonomy

NAME

  wp scaffold taxonomy

DESCRIPTION

  Generates PHP code for registering a custom taxonomy.

SYNOPSIS

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

ALIAS

  tax

OPTIONS

  <slug>
    The internal name of the taxonomy.

  [--post_types=<post-types>]
    Post types to register for use with the taxonomy.

  [--label=<label>]
    The text used to translate the update messages.

  [--textdomain=<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=<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

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

wp scaffold theme-tests

wp scaffold underscores