Skip to content

Add a core/comments-query ability #1064

Description

@whyisjake

Split out from #40, as requested there on 2026-07-16.

What problem does this address?

Comments are the third resource the 7.2 roadmap names for read-only coverage, and the plugin already has a consumer waiting for it: the Suggest Reply feature (#508) reads comments through its own code path rather than an ability. A core/read-comments ability gives Suggest Reply, the AI Workspace, and MCP clients one permission-checked way to fetch a comment or a thread.

Proposal

  • Name: core/comments-query
  • Category: content
  • Input: id (single comment) or list arguments: post, parent (thread), status (approve by default; hold, spam, trash, all gated by moderate_comments), type, author, author_email (gated), search, after/before, per_page, page, orderby, order. Returns total and total_pages.
  • Output per item: id, post id, parent, author display name, author id when present, date, content (rendered and raw for moderators only), status, type, link, and registered show_in_rest meta. Author email and IP only for users with moderate_comments, matching REST's context handling.
  • Permission: mirror WP_REST_Comments_Controller: approved comments on readable posts for anyone who can read the post; anything unapproved, or any private field, requires moderate_comments/edit_comment.
  • Annotations: readonly: true, idempotent: true, destructive: false.

Out of scope: replying, approving, or deleting (core/manage-comments, separate issue). Suggest Reply keeps its current path until this lands; migrating it is a follow-up.

Acceptance

  • Tests for: approved-only default, status=hold denied to a subscriber and allowed to an editor, private fields stripped for non-moderators, thread fetch by parent, comments on a private post hidden, pagination totals.
  • Abilities Explorer and MCP Adapter exposure verified.
  • WordPress Core Abilities #40 checklist updated.

Path to core

Prototype here; Trac ticket after the shape settles.

Activity

added this to the Future Release milestone on Sep 29, 2026
changed the title [-]Add a core/read-comments ability[/-] [+]Add a core/comments-query ability[/+] on Oct 1, 2026
changed the title [-]Add a core/comments-query ability[/-] [+]Add a `core/comments-query` ability[/+] on Oct 1, 2026

gziolo commented on Oct 1, 2026

@gziolo
Member

I’ve updated the title and description to reflect yesterday’s Core AI chat and the direction @jorgefilipecosta shared in the draft proposal. We’re aligning the names of read-only abilities that query collections around core/$collection-query, so this ability becomes core/comments-query.

theaminulai commented on Oct 3, 2026

@theaminulai
Member

Hi @jorgefilipecosta — I saw this got assigned to you, but I'd already started on it and have the single-comment-by-ID lookup mode implemented and open as #1100. Apologies for any overlap this causes!

Whenever you have a chance, I'd really appreciate your review on #1100 — happy to adjust the approach if it doesn't match the direction you had in mind from the draft proposal.

modified the milestones: Future Release, 1.5.0 on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions