Skip to content

Commit 1e7f946

Browse files
authored
Merge pull request #17 from wp-cli/post-term-list-field
Support `--field=<field>` when using `wp post term list`
2 parents ad1c634 + 3695524 commit 1e7f946

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

features/post-term.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ Feature: Manage post term
5050
1
5151
"""
5252

53+
When I run `wp post term list 1 category --field=slug`
54+
Then STDOUT should be:
55+
"""
56+
new
57+
"""
58+
5359
When I run `wp post term remove 1 category new`
5460
Then STDOUT should be:
5561
"""

src/WP_CLI/CommandWithTerms.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ abstract class CommandWithTerms extends \WP_CLI_Command {
4141
* <taxonomy>...
4242
* : One or more taxonomies to list.
4343
*
44+
* [--field=<field>]
45+
* : Prints the value of a single field for each term.
46+
*
4447
* [--fields=<fields>]
4548
* : Limit the output to specific row fields.
4649
*

0 commit comments

Comments
 (0)