Skip to content

Commit 6392d55

Browse files
committed
Add maintenance-mode command
1 parent 3e75e05 commit 6392d55

File tree

7 files changed

+185
-1
lines changed

7 files changed

+185
-1
lines changed

bin/commands-manifest.json

+40
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@
151151
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/language.md",
152152
"repo_url": "https:\/\/github.com\/wp-cli\/language-command"
153153
},
154+
"maintenance-mode": {
155+
"title": "maintenance-mode",
156+
"slug": "maintenance-mode",
157+
"cmd_path": "maintenance-mode",
158+
"parent": null,
159+
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/maintenance-mode.md",
160+
"repo_url": "https:\/\/github.com\/wp-cli\/maintenance-mode-command"
161+
},
154162
"media": {
155163
"title": "media",
156164
"slug": "media",
@@ -1031,6 +1039,38 @@
10311039
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/language\/theme.md",
10321040
"repo_url": "https:\/\/github.com\/wp-cli\/language-command"
10331041
},
1042+
"maintenance-mode\/activate": {
1043+
"title": "maintenance-mode activate",
1044+
"slug": "activate",
1045+
"cmd_path": "maintenance-mode\/activate",
1046+
"parent": "maintenance-mode",
1047+
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/maintenance-mode\/activate.md",
1048+
"repo_url": "https:\/\/github.com\/wp-cli\/maintenance-mode-command"
1049+
},
1050+
"maintenance-mode\/deactivate": {
1051+
"title": "maintenance-mode deactivate",
1052+
"slug": "deactivate",
1053+
"cmd_path": "maintenance-mode\/deactivate",
1054+
"parent": "maintenance-mode",
1055+
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/maintenance-mode\/deactivate.md",
1056+
"repo_url": "https:\/\/github.com\/wp-cli\/maintenance-mode-command"
1057+
},
1058+
"maintenance-mode\/is-active": {
1059+
"title": "maintenance-mode is-active",
1060+
"slug": "is-active",
1061+
"cmd_path": "maintenance-mode\/is-active",
1062+
"parent": "maintenance-mode",
1063+
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/maintenance-mode\/is-active.md",
1064+
"repo_url": "https:\/\/github.com\/wp-cli\/maintenance-mode-command"
1065+
},
1066+
"maintenance-mode\/status": {
1067+
"title": "maintenance-mode status",
1068+
"slug": "status",
1069+
"cmd_path": "maintenance-mode\/status",
1070+
"parent": "maintenance-mode",
1071+
"markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/master\/commands\/maintenance-mode\/status.md",
1072+
"repo_url": "https:\/\/github.com\/wp-cli\/maintenance-mode-command"
1073+
},
10341074
"media\/image-size": {
10351075
"title": "media image-size",
10361076
"slug": "image-size",

commands/maintenance-mode.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# wp maintenance-mode
2+
3+
Activates, deactivates or checks the status of the maintenance mode of a site.
4+
5+
### EXAMPLES
6+
7+
# Activate Maintenance mode.
8+
$ wp maintenance-mode activate
9+
Enabling Maintenance mode...
10+
Success: Activated Maintenance mode.
11+
12+
# Deactivate Maintenance mode.
13+
$ wp maintenance-mode deactivate
14+
Disabling Maintenance mode...
15+
Success: Deactivated Maintenance mode.
16+
17+
# Display Maintenance mode status.
18+
$ wp maintenance-mode status
19+
Maintenance mode is active.
20+
21+
# Get Maintenance mode status for scripting purpose.
22+
$ wp maintenance-mode is-active
23+
$ echo $?
24+
1
25+
26+

commands/maintenance-mode/activate.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# wp maintenance-mode activate
2+
3+
Activates maintenance mode.
4+
5+
[\--force]
6+
: Force maintenance mode activation operation.
7+
8+
### EXAMPLES
9+
10+
$ wp maintenance-mode activate
11+
Enabling Maintenance mode...
12+
Success: Activated Maintenance mode.
13+
14+
### GLOBAL PARAMETERS
15+
16+
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.
17+
18+
| **Argument** | **Description** |
19+
|:----------------|:-----------------------------|
20+
| `--path=<path>` | Path to the WordPress files. |
21+
| `--url=<url>` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
22+
| `--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant"). |
23+
| `--http=<http>` | Perform operation against a remote WordPress installation over HTTP. |
24+
| `--user=<id\|login\|email>` | Set the WordPress user. |
25+
| `--skip-plugins[=<plugins>]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
26+
| `--skip-themes[=<themes>]` | Skip loading all themes, or a comma-separated list of themes. |
27+
| `--skip-packages` | Skip loading all installed packages. |
28+
| `--require=<path>` | Load PHP file before running the command (may be used more than once). |
29+
| `--[no-]color` | Whether to colorize the output. |
30+
| `--debug[=<group>]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
31+
| `--prompt[=<assoc>]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
32+
| `--quiet` | Suppress informational messages. |
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# wp maintenance-mode deactivate
2+
3+
Deactivates maintenance mode.
4+
5+
### EXAMPLES
6+
7+
$ wp maintenance-mode deactivate
8+
Disabling Maintenance mode...
9+
Success: Deactivated Maintenance mode.
10+
11+
### GLOBAL PARAMETERS
12+
13+
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.
14+
15+
| **Argument** | **Description** |
16+
|:----------------|:-----------------------------|
17+
| `--path=<path>` | Path to the WordPress files. |
18+
| `--url=<url>` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
19+
| `--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant"). |
20+
| `--http=<http>` | Perform operation against a remote WordPress installation over HTTP. |
21+
| `--user=<id\|login\|email>` | Set the WordPress user. |
22+
| `--skip-plugins[=<plugins>]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
23+
| `--skip-themes[=<themes>]` | Skip loading all themes, or a comma-separated list of themes. |
24+
| `--skip-packages` | Skip loading all installed packages. |
25+
| `--require=<path>` | Load PHP file before running the command (may be used more than once). |
26+
| `--[no-]color` | Whether to colorize the output. |
27+
| `--debug[=<group>]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
28+
| `--prompt[=<assoc>]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
29+
| `--quiet` | Suppress informational messages. |
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# wp maintenance-mode is-active
2+
3+
Detects maintenance mode status.
4+
5+
### EXAMPLES
6+
7+
$ wp maintenance-mode is-active
8+
$ echo $?
9+
1
10+
11+
### GLOBAL PARAMETERS
12+
13+
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.
14+
15+
| **Argument** | **Description** |
16+
|:----------------|:-----------------------------|
17+
| `--path=<path>` | Path to the WordPress files. |
18+
| `--url=<url>` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
19+
| `--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant"). |
20+
| `--http=<http>` | Perform operation against a remote WordPress installation over HTTP. |
21+
| `--user=<id\|login\|email>` | Set the WordPress user. |
22+
| `--skip-plugins[=<plugins>]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
23+
| `--skip-themes[=<themes>]` | Skip loading all themes, or a comma-separated list of themes. |
24+
| `--skip-packages` | Skip loading all installed packages. |
25+
| `--require=<path>` | Load PHP file before running the command (may be used more than once). |
26+
| `--[no-]color` | Whether to colorize the output. |
27+
| `--debug[=<group>]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
28+
| `--prompt[=<assoc>]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
29+
| `--quiet` | Suppress informational messages. |

commands/maintenance-mode/status.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# wp maintenance-mode status
2+
3+
Displays maintenance mode status.
4+
5+
### EXAMPLES
6+
7+
$ wp maintenance-mode status
8+
Maintenance mode is active.
9+
10+
### GLOBAL PARAMETERS
11+
12+
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.
13+
14+
| **Argument** | **Description** |
15+
|:----------------|:-----------------------------|
16+
| `--path=<path>` | Path to the WordPress files. |
17+
| `--url=<url>` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
18+
| `--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant"). |
19+
| `--http=<http>` | Perform operation against a remote WordPress installation over HTTP. |
20+
| `--user=<id\|login\|email>` | Set the WordPress user. |
21+
| `--skip-plugins[=<plugins>]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
22+
| `--skip-themes[=<themes>]` | Skip loading all themes, or a comma-separated list of themes. |
23+
| `--skip-packages` | Skip loading all installed packages. |
24+
| `--require=<path>` | Load PHP file before running the command (may be used more than once). |
25+
| `--[no-]color` | Whether to colorize the output. |
26+
| `--debug[=<group>]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
27+
| `--prompt[=<assoc>]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
28+
| `--quiet` | Suppress informational messages. |

commands/rewrite/structure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Updates the permalink structure.
44

55
Sets the post permalink structure to the specified pattern.
66

7-
To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module to your [WP-CLI config](http://wp-cli.org/config/). For example:
7+
To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module to your [WP-CLI config](https://make.wordpress.org/cli/handbook/config/#config-files). For example:
88

99
```
1010
apache_modules:

0 commit comments

Comments
 (0)