Skip to content
23 changes: 23 additions & 0 deletions bin/Handbook_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,29 @@ private static function gen_cmd_pages( $cmd, $parent = [], $verbose = false ) {
WP_CLI::log( 'Generated commands/' . $binding['path'] . '/' );
}

// Generate alias page if command has an alias.
if ( ! empty( $cmd['alias'] ) ) {
$alias_parent = $parent;
$alias_parent[ count( $alias_parent ) - 1 ] = $cmd['alias'];
$alias_binding = $binding;
$alias_binding['synopsis'] = implode( ' ', $alias_parent );
$alias_binding['path'] = implode( '/', $alias_parent );
$alias_binding['description'] .= sprintf( "\n\nThis is an alias for `wp %s`.", $binding['synopsis'] );
$alias_path = dirname( __DIR__ ) . '/commands/' . $alias_binding['path'];
$alias_dir = dirname( $alias_path );

// Don't mention alias for the alias.
unset( $alias_binding['alias'] );

if ( ! is_dir( $alias_dir ) ) {
mkdir( $alias_dir, 0755, true );
}
file_put_contents( "$alias_path.md", self::render( 'subcmd-list.mustache', $alias_binding ) );
if ( $verbose ) {
WP_CLI::log( 'Generated commands/' . $alias_binding['path'] . '/ (alias)' );
}
}

if ( ! isset( $cmd['subcommands'] ) ) {
return;
}
Expand Down
112 changes: 112 additions & 0 deletions bin/commands-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/db\/columns.md",
"repo_url": "https:\/\/github.com\/wp-cli\/db-command"
},
"db\/connect": {
"title": "db connect",
"slug": "connect",
"cmd_path": "db\/connect",
"parent": "db",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/db\/connect.md"
},
"db\/create": {
"title": "db create",
"slug": "create",
Expand All @@ -1055,6 +1062,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/db\/drop.md",
"repo_url": "https:\/\/github.com\/wp-cli\/db-command"
},
"db\/dump": {
"title": "db dump",
"slug": "dump",
"cmd_path": "db\/dump",
"parent": "db",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/db\/dump.md"
},
"db\/export": {
"title": "db export",
"slug": "export",
Expand Down Expand Up @@ -1407,6 +1421,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/option\/set-autoload.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"option\/set": {
"title": "option set",
"slug": "set",
"cmd_path": "option\/set",
"parent": "option",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/option\/set.md"
},
"option\/update": {
"title": "option update",
"slug": "update",
Expand Down Expand Up @@ -1583,6 +1604,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/plugin\/update.md",
"repo_url": "https:\/\/github.com\/wp-cli\/extension-command"
},
"plugin\/upgrade": {
"title": "plugin upgrade",
"slug": "upgrade",
"cmd_path": "plugin\/upgrade",
"parent": "plugin",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/plugin\/upgrade.md"
},
"plugin\/verify-checksums": {
"title": "plugin verify-checksums",
"slug": "verify-checksums",
Expand Down Expand Up @@ -1791,6 +1819,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/role\/reset.md",
"repo_url": "https:\/\/github.com\/wp-cli\/role-command"
},
"scaffold\/_s": {
"title": "scaffold _s",
"slug": "_s",
"cmd_path": "scaffold\/_s",
"parent": "scaffold",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/_s.md"
},
"scaffold\/block": {
"title": "scaffold block",
"slug": "block",
Expand All @@ -1807,6 +1842,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/child-theme.md",
"repo_url": "https:\/\/github.com\/wp-cli\/scaffold-command"
},
"scaffold\/cpt": {
"title": "scaffold cpt",
"slug": "cpt",
"cmd_path": "scaffold\/cpt",
"parent": "scaffold",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/cpt.md"
},
"scaffold\/plugin-tests": {
"title": "scaffold plugin-tests",
"slug": "plugin-tests",
Expand All @@ -1831,6 +1873,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/post-type.md",
"repo_url": "https:\/\/github.com\/wp-cli\/scaffold-command"
},
"scaffold\/tax": {
"title": "scaffold tax",
"slug": "tax",
"cmd_path": "scaffold\/tax",
"parent": "scaffold",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/tax.md"
},
"scaffold\/taxonomy": {
"title": "scaffold taxonomy",
"slug": "taxonomy",
Expand Down Expand Up @@ -2231,6 +2280,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/theme\/status.md",
"repo_url": "https:\/\/github.com\/wp-cli\/extension-command"
},
"theme\/uninstall": {
"title": "theme uninstall",
"slug": "uninstall",
"cmd_path": "theme\/uninstall",
"parent": "theme",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/theme\/uninstall.md"
},
"theme\/update": {
"title": "theme update",
"slug": "update",
Expand All @@ -2239,6 +2295,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/theme\/update.md",
"repo_url": "https:\/\/github.com\/wp-cli\/extension-command"
},
"theme\/upgrade": {
"title": "theme upgrade",
"slug": "upgrade",
"cmd_path": "theme\/upgrade",
"parent": "theme",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/theme\/upgrade.md"
},
"transient\/delete": {
"title": "transient delete",
"slug": "delete",
Expand Down Expand Up @@ -2823,6 +2886,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/comment\/meta\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"comment\/meta\/set": {
"title": "comment meta set",
"slug": "set",
"cmd_path": "comment\/meta\/set",
"parent": "comment\/meta",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/comment\/meta\/set.md"
},
"comment\/meta\/update": {
"title": "comment meta update",
"slug": "update",
Expand Down Expand Up @@ -3175,6 +3245,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/network\/meta\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"network\/meta\/set": {
"title": "network meta set",
"slug": "set",
"cmd_path": "network\/meta\/set",
"parent": "network\/meta",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/network\/meta\/set.md"
},
"network\/meta\/update": {
"title": "network meta update",
"slug": "update",
Expand Down Expand Up @@ -3263,6 +3340,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/post\/meta\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"post\/meta\/set": {
"title": "post meta set",
"slug": "set",
"cmd_path": "post\/meta\/set",
"parent": "post\/meta",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/post\/meta\/set.md"
},
"post\/meta\/update": {
"title": "post meta update",
"slug": "update",
Expand Down Expand Up @@ -3351,6 +3435,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/site\/meta\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"site\/meta\/set": {
"title": "site meta set",
"slug": "set",
"cmd_path": "site\/meta\/set",
"parent": "site\/meta",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/site\/meta\/set.md"
},
"site\/meta\/update": {
"title": "site meta update",
"slug": "update",
Expand Down Expand Up @@ -3407,6 +3498,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/site\/option\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"site\/option\/set": {
"title": "site option set",
"slug": "set",
"cmd_path": "site\/option\/set",
"parent": "site\/option",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/site\/option\/set.md"
},
"site\/option\/update": {
"title": "site option update",
"slug": "update",
Expand Down Expand Up @@ -3463,6 +3561,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/term\/meta\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"term\/meta\/set": {
"title": "term meta set",
"slug": "set",
"cmd_path": "term\/meta\/set",
"parent": "term\/meta",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/term\/meta\/set.md"
},
"term\/meta\/update": {
"title": "term meta update",
"slug": "update",
Expand Down Expand Up @@ -3631,6 +3736,13 @@
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/user\/meta\/pluck.md",
"repo_url": "https:\/\/github.com\/wp-cli\/entity-command"
},
"user\/meta\/set": {
"title": "user meta set",
"slug": "set",
"cmd_path": "user\/meta\/set",
"parent": "user\/meta",
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/user\/meta\/set.md"
},
"user\/meta\/update": {
"title": "user meta update",
"slug": "update",
Expand Down
4 changes: 3 additions & 1 deletion bin/templates/subcmd-list.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# wp {{synopsis}}

{{description}}
{{description}}{{#alias}}

**Alias:** `{{alias}}`{{/alias}}

{{{docs}}}
49 changes: 49 additions & 0 deletions commands/comment/meta/set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# wp comment meta set

Update a meta field.

This is an alias for `wp comment meta update`.

### OPTIONS

See the [argument syntax](https://make.wordpress.org/cli/handbook/references/argument-syntax/) reference for a detailed explanation of the syntax conventions used.

<id>
: The ID of the object.

<key>
: The name of the meta field to update.

[<value>]
: The new value. If omitted, the value is read from STDIN.

[\--format=<format>]
: The serialization format for the value.
\---
default: plaintext
options:
- plaintext
- json
\---

### GLOBAL PARAMETERS

These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress.

| **Argument** | **Description** |
|:----------------|:-----------------------------|
| `--path=<path>` | Path to the WordPress files. |
| `--url=<url>` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
| `--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). |
| `--http=<http>` | Perform operation against a remote WordPress installation over HTTP. |
| `--user=<id\|login\|email>` | Set the WordPress user. |
| `--skip-plugins[=<plugins>]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
| `--skip-themes[=<themes>]` | Skip loading all themes, or a comma-separated list of themes. |
| `--skip-packages` | Skip loading all installed packages. |
| `--require=<path>` | Load PHP file before running the command (may be used more than once). |
| `--exec=<php-code>` | Execute PHP code before running the command (may be used more than once). |
| `--context=<context>` | Load WordPress in a given context. |
| `--[no-]color` | Whether to colorize the output. |
| `--debug[=<group>]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
| `--prompt[=<assoc>]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
| `--quiet` | Suppress informational messages. |
2 changes: 2 additions & 0 deletions commands/comment/meta/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Update a meta field.

**Alias:** `set`

### OPTIONS

See the [argument syntax](https://make.wordpress.org/cli/handbook/references/argument-syntax/) reference for a detailed explanation of the syntax conventions used.
Expand Down
59 changes: 59 additions & 0 deletions commands/core/install-network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# wp core install-network

Transforms an existing single-site installation into a multisite installation.

This is an alias for `wp core multisite-convert`.

Creates the multisite database tables, and adds the multisite constants to wp-config.php.

For those using WordPress with Apache, remember to update the `.htaccess` file with the appropriate multisite rewrite rules.

[Review the multisite documentation](https://wordpress.org/support/article/create-a-network/) for more details about how multisite works.

### OPTIONS

See the [argument syntax](https://make.wordpress.org/cli/handbook/references/argument-syntax/) reference for a detailed explanation of the syntax conventions used.

[\--title=&lt;network-title&gt;]
: The title of the new network.

[\--base=&lt;url-path&gt;]
: Base path after the domain name that each site url will start with.
\---
default: /
\---

[\--subdomains]
: If passed, the network will use subdomains, instead of subdirectories. Doesn't work with 'localhost'.

[\--skip-config]
: Don't add multisite constants to wp-config.php.

### EXAMPLES

$ wp core multisite-convert
Set up multisite database tables.
Added multisite constants to wp-config.php.
Success: Network installed. Don't forget to set up rewrite rules.

### GLOBAL PARAMETERS

These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress.

| **Argument** | **Description** |
|:----------------|:-----------------------------|
| `--path=<path>` | Path to the WordPress files. |
| `--url=<url>` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
| `--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). |
| `--http=<http>` | Perform operation against a remote WordPress installation over HTTP. |
| `--user=<id\|login\|email>` | Set the WordPress user. |
| `--skip-plugins[=<plugins>]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
| `--skip-themes[=<themes>]` | Skip loading all themes, or a comma-separated list of themes. |
| `--skip-packages` | Skip loading all installed packages. |
| `--require=<path>` | Load PHP file before running the command (may be used more than once). |
| `--exec=<php-code>` | Execute PHP code before running the command (may be used more than once). |
| `--context=<context>` | Load WordPress in a given context. |
| `--[no-]color` | Whether to colorize the output. |
| `--debug[=<group>]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
| `--prompt[=<assoc>]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
| `--quiet` | Suppress informational messages. |
2 changes: 2 additions & 0 deletions commands/core/multisite-convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Transforms an existing single-site installation into a multisite installation.

**Alias:** `install-network`

Creates the multisite database tables, and adds the multisite constants to wp-config.php.

For those using WordPress with Apache, remember to update the `.htaccess` file with the appropriate multisite rewrite rules.
Expand Down
2 changes: 2 additions & 0 deletions commands/core/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Updates WordPress to a newer version.

**Alias:** `upgrade`

Defaults to updating WordPress to the latest version.

If you see "Error: Another update is currently in progress.", you may need to run `wp option delete core_updater.lock` after verifying another update isn't actually running.
Expand Down
Loading