Skip to content
kcarwilemiller edited this page Dec 2, 2016 · 1 revision

Modern\Wordpress\CLI

Implements commands that can be executed from the WP CLI.

  • Class name: CLI
  • Namespace: Modern\Wordpress
  • Parent class: WP_CLI_Command

Methods

createPlugin

mixed Modern\Wordpress\CLI::createPlugin($args, $assoc)

Creates a new boilerplate modern wordpress plugin.

  • Visibility: public

Arguments

  • $args mixed - <p>array Positional command line arguments</p>
  • $assoc mixed - <p>array Named command line arguments</p> <h2>OPTIONS</h2> <name> : The name of the plugin.

[--vendor=<vendor>] : The name of the plugin provider.

[--namespace=<namespace>] : The Vendor\Package namespace for the plugin.

[--slug=<slug>] : The directory name that the plugin will be created in.

[--description=<description>] : The plugin description.

[--author=<author>] : The name of the plugin author.

[--author-url=<author_url>] : The plugin author web url.

[--plugin-url=<plugin_url>] : The plugin project url.

EXAMPLES

# Create a new plugin
$ wp mwp create &quot;My New Plugin&quot; --vendor=&quot;My Company&quot; --slug=&quot;example-plugin-dir&quot; --namespace=&quot;MyCompany\MyPlugin&quot; --description=&quot;A new plugin to customize.&quot;
Success: Plugin successfully created in &#039;example-plugin-dir&#039;.

updateBoilerplate

mixed Modern\Wordpress\CLI::updateBoilerplate($args, $assoc)

Update the wordpress plugin boilerplate

  • Visibility: public

Arguments

  • $args mixed - <p>array Positional command line arguments</p>
  • $assoc mixed - <p>array Named command line arguments</p> <h2>OPTIONS</h2> <url> : The download url of the current boilerplate to update to

EXAMPLES

# Update the boilerplate
$ wp mwp update-boilerplate https://github.com/Miller-Media/wp-plugin-boilerplate/archive/master.zip
Success: Boilerplate successfully updated.
Clone this wiki locally