Skip to content

Commit 50f907c

Browse files
authored
Merge pull request #92 from wp-cli/update-readme-tests
Update scaffolded README and tests with latest
2 parents 7081611 + 26acbc0 commit 50f907c

File tree

5 files changed

+246
-76
lines changed

5 files changed

+246
-76
lines changed

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ Lists, creates, assigns, and deletes the active theme's navigation menus.
7878
wp menu
7979
~~~
8080

81+
See the [Navigation Menus](https://developer.wordpress.org/themes/functionality/navigation-menus/) reference in the Theme Handbook.
82+
8183
**EXAMPLES**
8284

8385
# Create a new menu
@@ -188,6 +190,8 @@ Retrieves and sets site options, including plugin and WordPress settings.
188190
wp option
189191
~~~
190192

193+
See the [Plugin Settings API](https://developer.wordpress.org/plugins/settings/settings-api/) and the [Theme Options](https://developer.wordpress.org/themes/customize-api/) for more information on adding customized options.
194+
191195
**EXAMPLES**
192196

193197
# Get site URL.
@@ -324,7 +328,7 @@ wp option get <key> [--format=<format>]
324328
List options and their values.
325329

326330
~~~
327-
wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [--transients] [--field=<field>] [--fields=<fields>] [--format=<format>]
331+
wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [--transients] [--field=<field>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>]
328332
~~~
329333

330334
**OPTIONS**
@@ -360,6 +364,25 @@ wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [
360364
- total_bytes
361365
---
362366

367+
[--orderby=<fields>]
368+
Set orderby which field.
369+
---
370+
default: option_id
371+
options:
372+
- option_id
373+
- option_name
374+
- option_value
375+
---
376+
377+
[--order=<order>]
378+
Set ascending or descending order.
379+
---
380+
default: asc
381+
options:
382+
- asc
383+
- desc
384+
---
385+
363386
**AVAILABLE FIELDS**
364387

365388
This field will be displayed by default for each matching option:
@@ -543,12 +566,14 @@ wp post term
543566

544567
### wp post-type
545568

546-
Retrieves details on the site's registered post-types.
569+
Retrieves details on the site's registered post types.
547570

548571
~~~
549572
wp post-type
550573
~~~
551574

575+
Get information on WordPress' built-in and the site's [custom post types](https://developer.wordpress.org/plugins/post-types/).
576+
552577
**EXAMPLES**
553578

554579
# Get details about a post type
@@ -645,6 +670,8 @@ Retrieves information about registered taxonomies.
645670
wp taxonomy
646671
~~~
647672

673+
See references for [built-in taxonomies](https://developer.wordpress.org/themes/basics/categories-tags-custom-taxonomies/) and [custom taxonomies](https://developer.wordpress.org/plugins/taxonomies/working-with-custom-taxonomies/).
674+
648675
**EXAMPLES**
649676

650677
# List all taxonomies with 'post' object type.
@@ -665,12 +692,14 @@ wp taxonomy
665692

666693
### wp term
667694

668-
Manages taxonomy terms and term meta, including create, delete, and list.
695+
Manages taxonomy terms and term meta, with create, delete, and list commands.
669696

670697
~~~
671698
wp term
672699
~~~
673700

701+
See reference for [taxonomies and their terms](https://codex.wordpress.org/Taxonomies).
702+
674703
**EXAMPLES**
675704

676705
# Create a new term.
@@ -738,6 +767,8 @@ Manages users, along with their roles, capabilities, and meta.
738767
wp user
739768
~~~
740769

770+
See references for [Roles and Capabilities](https://codex.wordpress.org/Roles_and_Capabilities) and [WP User class](https://codex.wordpress.org/Class_Reference/WP_User).
771+
741772
**EXAMPLES**
742773

743774
# List user IDs

features/bootstrap/FeatureContext.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,15 @@ public function get_php_binary() {
699699
return 'php';
700700
}
701701

702-
public function start_php_server() {
702+
public function start_php_server( $subdir = '' ) {
703+
$dir = $this->variables['RUN_DIR'] . '/';
704+
if ( $subdir ) {
705+
$dir .= trim( $subdir, '/' ) . '/';
706+
}
703707
$cmd = Utils\esc_cmd( '%s -S %s -t %s -c %s %s',
704708
$this->get_php_binary(),
705709
'localhost:8080',
706-
$this->variables['RUN_DIR'] . '/wordpress/',
710+
$dir,
707711
get_cfg_var( 'cfg_file_path' ),
708712
$this->variables['RUN_DIR'] . '/vendor/wp-cli/server-command/router.php'
709713
);

features/bootstrap/Process.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,17 @@ public function run() {
8787
self::$run_times[ $this->command ][1]++;
8888
}
8989

90-
return new ProcessRun( array(
91-
'stdout' => $stdout,
92-
'stderr' => $stderr,
93-
'return_code' => $return_code,
94-
'command' => $this->command,
95-
'cwd' => $this->cwd,
96-
'env' => $this->env,
97-
'run_time' => $run_time,
98-
) );
90+
return new ProcessRun(
91+
array(
92+
'stdout' => $stdout,
93+
'stderr' => $stderr,
94+
'return_code' => $return_code,
95+
'command' => $this->command,
96+
'cwd' => $this->cwd,
97+
'env' => $this->env,
98+
'run_time' => $run_time,
99+
)
100+
);
99101
}
100102

101103
/**
@@ -107,7 +109,7 @@ public function run_check() {
107109
$r = $this->run();
108110

109111
// $r->STDERR is incorrect, but kept incorrect for backwards-compat
110-
if ( $r->return_code || !empty( $r->STDERR ) ) {
112+
if ( $r->return_code || ! empty( $r->STDERR ) ) {
111113
throw new \RuntimeException( $r );
112114
}
113115

0 commit comments

Comments
 (0)