Skip to content

Commit 892b306

Browse files
authored
Merge pull request #569 from wp-cli/copilot/add-term-group-parameter
Add term_group as optionally available field in wp term list
2 parents b551837 + b691de1 commit 892b306

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

features/term.feature

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,21 @@ Feature: Manage WordPress terms
280280
"""
281281
Success: Term updated.
282282
"""
283+
284+
Scenario: Term list includes term_group as optional field
285+
When I run `wp term create category 'Group Test' --slug=group-test --description='Test term_group field'`
286+
Then STDOUT should not be empty
287+
288+
When I run `wp term list category --format=csv --fields=name,term_group`
289+
Then STDOUT should contain:
290+
"""
291+
term_group
292+
"""
293+
294+
When I run `wp term list category --format=json --fields=term_id,name,term_group`
295+
Then STDOUT should be JSON containing:
296+
"""
297+
[{
298+
"term_group":0
299+
}]
300+
"""

src/Term_Command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class Term_Command extends WP_CLI_Command {
9393
*
9494
* These fields are optionally available:
9595
*
96+
* * term_group
9697
* * url
9798
*
9899
* ## EXAMPLES

0 commit comments

Comments
 (0)