br-resource-cpt
CommunityAuto-generate CPT REST endpoints with confidence.
AuthorLonsdale201
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill enables developers to generate a complete REST CRUD endpoint suite for a WordPress custom post type by leveraging Better Route's Resource API, reducing boilerplate and ensuring consistent behavior across actions.
Core Features & Use Cases
- Fluent CPT-to-REST generation using Resource::make(...)->sourceCpt(...)->fields(...)->policy(...)->register($router) to emit list/get/create/update/patch/delete routes.
- Fine-grained access control with policy and fieldPolicy, plus dynamic visibility via cptVisibleStatuses and cptVisibilityPolicy.
- Built-in validation via writeSchema and payloadSchema aliases, plus filter and sort allowlists to secure inputs.
- Automatic route registration under a required restNamespace, with options for deleteMode and envelope shaping.
- Suitable for migrating hand-rolled register_rest_route setups into a single Resource-based workflow.
Quick Start
Create the CPT REST API by configuring a Resource with a source CPT, policy, and router, then register it to expose CRUD endpoints.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: br-resource-cpt Download link: https://github.com/Lonsdale201/wp-agent-skills/archive/main.zip#br-resource-cpt Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.