Skip to content

Commit 5690960

Browse files
Minor documentation tweaks to wp eval-file (#68)
* Update EvalFile_Command.php 1. Note that arguments are positional. 2. Example is not visible in the docs. Fix formatting. * Update EvalFile_Command.php * Fix PHPCS errors --------- Co-authored-by: Daniel Bachhuber <[email protected]>
1 parent 7f3e863 commit 5690960

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/EvalFile_Command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class EvalFile_Command extends WP_CLI_Command {
2323
* : The path to the PHP file to execute. Use '-' to run code from STDIN.
2424
*
2525
* [<arg>...]
26-
* : One or more arguments to pass to the file. They are placed in the $args variable.
26+
* : One or more positional arguments to pass to the file. They are placed in the $args variable.
2727
*
2828
* [--skip-wordpress]
2929
* : Load and execute file without loading WordPress.
@@ -35,7 +35,9 @@ class EvalFile_Command extends WP_CLI_Command {
3535
*
3636
* ## EXAMPLES
3737
*
38-
* wp eval-file my-code.php value1 value2
38+
* # Execute file my-code.php and pass value1 and value2 arguments.
39+
* # Access arguments in $args array ($args[0] = value1, $args[1] = value2).
40+
* $ wp eval-file my-code.php value1 value2
3941
*/
4042
public function __invoke( $args, $assoc_args ) {
4143
$file = array_shift( $args );

0 commit comments

Comments
 (0)