Skip to content

Add a core/terms-query ability (taxonomies, categories, tags) #1063

Description

@whyisjake

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

What problem does this address?

The 7.2 roadmap names taxonomies among the read-only resources to cover. Agents that draft or classify content today have no ability-level way to learn which categories and tags exist, so they either guess names or fall back to REST. #40 proposed four narrow abilities (find-categories, get-category, find-tags, get-tag); the read/manage direction since adopted argues for one.

Proposal

  • Name: core/terms-query
  • Category: content
  • Input: taxonomy (required for listing; any public taxonomy or a taxonomy with show_in_rest), id (single term), search, parent, hide_empty, include/exclude, slug, post (terms attached to a post), per_page, page, orderby, order. Returns total and total_pages.
  • Output per item: id, taxonomy, name, slug, description, parent, count, link, and registered show_in_rest meta.
  • Permission: mirror WP_REST_Terms_Controller: public taxonomies readable by anyone allowed to read the site; non-public taxonomies require the taxonomy's assign_terms/manage_terms capability as the REST controller does.
  • Annotations: readonly: true, idempotent: true, destructive: false.

A companion core/read-taxonomies (the list of registered taxonomies with labels, hierarchy, and which post types they apply to) is small and probably belongs in the same PR, since an agent needs it to know what to pass as taxonomy. Suggest deciding in review whether that is one ability with a mode or two.

Out of scope: creating, assigning, or deleting terms (core/manage-terms, separate issue).

Acceptance

  • Tests for public vs non-public taxonomy access, hierarchical listing with parent, terms-for-a-post, pagination totals, show_in_rest meta only.
  • Abilities Explorer and MCP Adapter exposure verified.
  • WordPress Core Abilities #40 checklist updated.

Path to core

Prototype here; Trac ticket after the shape settles, following #64606 and #64657.

Activity

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