Skip to content

Commit dd74f01

Browse files
Copilotswissspidy
andcommitted
Make term_group an optionally available field instead of default
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 03a13d9 commit dd74f01

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎features/term.feature‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Feature: Manage WordPress terms
281281
Success: Term updated.
282282
"""
283283

284-
Scenario: Term list includes term_group field
284+
Scenario: Term list includes term_group as optional field
285285
When I run `wp term create category 'Group Test' --slug=group-test --description='Test term_group field'`
286286
Then STDOUT should not be empty
287287

@@ -291,7 +291,7 @@ Feature: Manage WordPress terms
291291
term_group
292292
"""
293293

294-
When I run `wp term list category --format=json`
294+
When I run `wp term list category --format=json --fields=term_id,name,term_group`
295295
Then STDOUT should be JSON containing:
296296
"""
297297
[{

‎src/Term_Command.php‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class Term_Command extends WP_CLI_Command {
4747
'description',
4848
'parent',
4949
'count',
50-
'term_group',
5150
];
5251

5352
/**
@@ -91,21 +90,21 @@ class Term_Command extends WP_CLI_Command {
9190
* * description
9291
* * parent
9392
* * count
94-
* * term_group
9593
*
9694
* These fields are optionally available:
9795
*
96+
* * term_group
9897
* * url
9998
*
10099
* ## EXAMPLES
101100
*
102101
* # List post categories
103102
* $ wp term list category --format=csv
104-
* term_id,term_taxonomy_id,name,slug,description,parent,count,term_group
105-
* 2,2,aciform,aciform,,0,1,0
106-
* 3,3,antiquarianism,antiquarianism,,0,1,0
107-
* 4,4,arrangement,arrangement,,0,1,0
108-
* 5,5,asmodeus,asmodeus,,0,1,0
103+
* term_id,term_taxonomy_id,name,slug,description,parent,count
104+
* 2,2,aciform,aciform,,0,1
105+
* 3,3,antiquarianism,antiquarianism,,0,1
106+
* 4,4,arrangement,arrangement,,0,1
107+
* 5,5,asmodeus,asmodeus,,0,1
109108
*
110109
* # List post tags
111110
* $ wp term list post_tag --fields=name,slug

0 commit comments

Comments
 (0)