Wp rest api

From wpgaurav/WordPress-skills · View interactive version

Wp rest api is an AI agent skill from the GitHub repository wpgaurav/WordPress-skills. Use when building, extending, or debugging WordPress REST API endpoints/routes: register_rest_route, WP_REST_Controller/controller classes, schema/argument validation, permission_callback/authentication, response shaping, register_rest_field/register_meta, or exposing CPTs/taxonomies via show_in_res

How to use this skill

Skill file

From Agent Skills for WordPress. Copyright (C) 2026 WordPress Contributors, licensed under GPL-2.0-or-later. Changed from upstream: the compatibility: frontmatter line was dropped when this copy was made in March 2026, and license frontmatter plus this notice were added on 2026-10-24. See NOTICE.md.

WP REST API

When to use

Use this skill when you need to:

Inputs required

Procedure

0) Triage and locate REST usage

  1. Run triage:
  1. Search for existing REST usage:

If this is a full site repo, pick the specific plugin/theme before changing code.

1) Choose the right approach

2) Register routes safely (namespaces, methods, permissions)

Read references/routes-and-endpoints.md.

3) Validate/sanitize request args

Read references/schema.md.

4) Responses, fields, and links

Read references/responses-and-fields.md.

5) Authentication and authorization

Read references/authentication.md.

6) Client-facing behavior (discovery, pagination, embeds)

Read references/discovery-and-params.md.

Verification

Failure modes / debugging

Escalation

If version support or behavior is unclear, consult the REST API Handbook and core docs before inventing patterns.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.