-
Notifications
You must be signed in to change notification settings - Fork 92
Add term_group as optionally available field in wp term list #569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: swissspidy <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds documentation for the term_group field as an optionally available field in the wp term list command. The term_group field is a core WordPress term property that was previously undocumented despite being accessible.
Changes:
- Added
term_groupto the list of optionally available fields inTerm_Command::list_()documentation - Added Behat test coverage to verify
term_groupcan be accessed via the--fieldsparameter in both CSV and JSON formats
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Term_Command.php | Adds term_group to the "optionally available fields" documentation section for the list command |
| features/term.feature | Adds test scenario to verify term_group field can be accessed when explicitly requested via --fields parameter |
Comments suppressed due to low confidence (1)
src/Term_Command.php:118
- Consider adding an example demonstrating the usage of the
term_groupfield, similar to how theurlfield is demonstrated in lines 25-27 of the class documentation. For instance:
# List categories with term_group field
$ wp term list category --fields=term_id,name,term_group --format=csv
term_id,name,term_group
2,aciform,0
This would make it clearer to users how to access this optional field, aligning with the PR description's mention of "updated example documentation".
* ## EXAMPLES
*
* # List post categories
* $ wp term list category --format=csv
* term_id,term_taxonomy_id,name,slug,description,parent,count
* 2,2,aciform,aciform,,0,1
* 3,3,antiquarianism,antiquarianism,,0,1
* 4,4,arrangement,arrangement,,0,1
* 5,5,asmodeus,asmodeus,,0,1
*
* # List post tags
* $ wp term list post_tag --fields=name,slug
* +-----------+-------------+
* | name | slug |
* +-----------+-------------+
* | 8BIT | 8bit |
* | alignment | alignment-2 |
* | Articles | articles |
* | aside | aside |
* +-----------+-------------+
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The
term_groupfield was not documented as an available field forwp term listdespite being a core WordPress term property.Changes
term_groupto the "optionally available fields" documentation inTerm_Commandterm_groupwhen neededterm_groupcan be accessed via the--fieldsparameterUsage
By default,
term_groupis not included in the output to keep the default field list concise. Users can explicitly request it:This approach makes
term_groupaccessible for users who need it while respecting that it's a half-baked WordPress feature not commonly used in practice.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.