You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WP-CLI's goal is to provide a command-line interface for any action you might want to perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) lets you install and activate a WordPress plugin:
28
28
29
-
```
29
+
```bash
30
30
$ wp plugin install rest-api --activate
31
31
Installing WordPress REST API (Version 2) (2.0-beta13)
32
32
Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip...
WP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) lets you delete one or all transients:
41
41
42
-
```
42
+
```bash
43
43
$ wp transient delete-all
44
44
Success: 34 transients deleted from the database.
45
45
```
@@ -60,26 +60,26 @@ Before installing WP-CLI, please make sure your environment meets the minimum re
60
60
61
61
Once you've verified requirements, download the [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`:
To use WP-CLI from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example:
74
74
75
-
```
75
+
```bash
76
76
$ chmod +x wp-cli.phar
77
77
$ sudo mv wp-cli.phar /usr/local/bin/wp
78
78
```
79
79
80
80
If WP-CLI was installed successfully, you should see something like this when you run `wp --info`:
81
81
82
-
```
82
+
```bash
83
83
$ wp --info
84
84
PHP binary: /usr/bin/php5
85
85
PHP version: 5.5.9-1ubuntu4.14
@@ -101,15 +101,15 @@ Want to live life on the edge? Run `wp cli update --nightly` to use the latest n
101
101
102
102
WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://github.com/wp-cli/wp-cli/raw/master/utils/wp-completion.bash) and source it from `~/.bash_profile`:
103
103
104
-
```
104
+
```bash
105
105
source /FULL/PATH/TO/wp-completion.bash
106
106
```
107
107
108
108
Don't forget to run `source ~/.bash_profile` afterwards.
109
109
110
110
If using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`:
111
111
112
-
```
112
+
```bash
113
113
autoload bashcompinit
114
114
bashcompinit
115
115
source /FULL/PATH/TO/wp-completion.bash
@@ -136,7 +136,7 @@ A **command** is an atomic unit of WP-CLI functionality. `wp plugin install` ([d
136
136
137
137
WP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration.
0 commit comments