Skip to content

Commit 56cf736

Browse files
authored
Merge pull request #84 from wp-cli/regenerate-readme
2 parents f7d7505 + c5fc603 commit 56cf736

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contr
1010
## Using
1111

1212
~~~
13-
wp shell [--basic]
13+
wp shell [--basic] [--hook=<hook>]
1414
~~~
1515

1616
`wp shell` allows you to evaluate PHP statements and expressions
@@ -25,13 +25,24 @@ that you can use within a WordPress plugin, for example.
2525
Force the use of WP-CLI's built-in PHP REPL, even if the Boris or
2626
PsySH PHP REPLs are available.
2727

28+
[--hook=<hook>]
29+
Ensure that a specific WordPress action hook has fired before starting the shell.
30+
This validates that the preconditions associated with that hook are met.
31+
Only hooks that have already been triggered can be used (e.g., init, plugins_loaded, wp_loaded).
32+
---
33+
default: ''
34+
---
35+
2836
**EXAMPLES**
2937

3038
# Call get_bloginfo() to get the name of the site.
3139
$ wp shell
3240
wp> get_bloginfo( 'name' );
3341
=> string(6) "WP-CLI"
3442

43+
# Start a shell, ensuring the 'init' hook has already fired.
44+
$ wp shell --hook=init
45+
3546
## Installing
3647

3748
This package is included with WP-CLI itself, no additional installation necessary.

0 commit comments

Comments
 (0)