Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

Help text for wp post|user term|meta subcommands used generic "object" terminology inherited from abstract base classes. For example, wp post term list --help displayed "List all terms associated with an object" instead of "...with a post".

Changes

Override public methods in concrete command classes with entity-specific docblocks:

  • Post_Term_Command: list_, add, remove, set - "post" terminology
  • User_Term_Command: list_, add, remove, set - "user" terminology
  • Post_Meta_Command: list_, get, add, update, delete, pluck, patch - "post" terminology
  • User_Meta_Command: pluck, patch - "user" terminology (extends existing overrides)

Each override delegates to parent implementation while providing specific documentation that WP-CLI's reflection-based help system reads.

// Before: Generic documentation in CommandWithTerms
/**
 * List all terms associated with an object.
 * <id>
 * : ID for the object.
 */
public function list_( $args, $assoc_args ) { /* ... */ }

// After: Specific documentation in Post_Term_Command
/**
 * List all terms associated with a post.
 * <id>
 * : ID for the post.
 */
// phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found -- Override to provide specific documentation.
public function list_( $args, $assoc_args ) {
    parent::list_( $args, $assoc_args );
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Avoid the generic terminology used for term and meta subcommand descriptions</issue_title>
<issue_description>The descriptions for the second-level subcommands of wp post|user term|meta use generic "object" terminology from the method docblocks in the abstract CommandWithTerms and CommandWithMeta classes. For example:

  • wp post term --help correctly says "Adds, updates, removes, and lists post terms."
  • wp post term list --help uses the generic phrase "List all terms associated with an object."

Generic terminology is used for all four term and meta subcommands:

wp (post|user) (term|meta) (add|list|remove|set) --help

It would be great if the descriptions and argument synopses for these commands didn't use generic terminology.</issue_description>

Comments on the Issue (you are @copilot in this section)

@schlessera This is because most of the code is in a shared abstract class, so the docblocks only exist once for all "objects".

I agree that it would be preferable to get rid of the generic terms, though. I'll have a look to see how best to achieve that without copying the logic around.</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 7, 2026 17:35
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Avoid generic terminology in term and meta subcommand descriptions Override command method docblocks to replace generic "object" with specific entity types Jan 7, 2026
Copilot AI requested a review from swissspidy January 7, 2026 17:40
@swissspidy swissspidy marked this pull request as ready for review January 7, 2026 17:48
@swissspidy swissspidy requested a review from a team as a code owner January 7, 2026 17:48
@swissspidy swissspidy marked this pull request as draft January 7, 2026 17:48
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/User_Meta_Command.php 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid the generic terminology used for term and meta subcommand descriptions

2 participants