WordPress/wp-rest-api — Agent Skills | officialskills.sh
Back to skills

wp-rest-api

communitydevelopment

Handles everything related to the WordPress REST API layer: registering custom routes and controller classes, validating request arguments with JSON Schema, managing authentication with nonces or application passwords, and exposing custom post types and taxonomies via REST endpoints.

Setup & Installation

npx skills add https://github.com/WordPress/agent-skills --skill wp-rest-api
or paste the link and ask your coding assistant to install it
https://github.com/WordPress/agent-skills/tree/trunk/skills/wp-rest-api
View on GitHub

What This Skill Does

Handles everything related to the WordPress REST API layer: registering custom routes and controller classes, validating request arguments with JSON Schema, managing authentication with nonces or application passwords, and exposing custom post types and taxonomies via REST endpoints.

Rather than manually tracing WordPress hook order and schema rules, this skill handles the full lifecycle from route registration to response shaping and authentication, covering the edge cases that the official handbook buries in footnotes.

When to use it

  • Registering a custom namespace endpoint to serve data to a decoupled React front end
  • Exposing a custom post type in the wp/v2 namespace by setting show_in_rest
  • Adding computed or meta fields to REST responses with register_rest_field
  • Debugging 401 and 403 errors caused by missing nonces or misconfigured permission callbacks
  • Restricting a custom route to users with specific capabilities via permission_callback