File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff 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
3748This package is included with WP-CLI itself, no additional installation necessary.
You can’t perform that action at this time.
0 commit comments