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.