Register custom REST routes via better-route's fluent Router — BetterRoute::router('vendor', 'v1') gives a Router with ->get / ->post / ->p…
“网络安全”领域的一个 Skill。已为 Claude Code, Codex, OpenCode 及另外 32 个智能体 准备好命令。
完整描述
Register custom REST routes via better-route's fluent Router — BetterRoute::router('vendor', 'v1') gives a Router with ->get / ->post / ->put / ->patch / ->delete / ->options returning a RouteBuilder for fluent options (->permission, ->protectedByMiddleware, ->publicRoute, ->meta, ->middleware). Critical v0.4.0 rule — POST / PUT / PATCH / DELETE without an explicit permission declaration deny by default at the WP layer (return 403 before the handler runs); GET and OPTIONS are public by default. Use ->permission(callable) for WP capability checks, ->protectedByMiddleware($security) when an auth middleware handles authentication, ->publicRoute() for intentionally public endpoints. Route handlers receive ID from URL route params first (query / body ID is consulted only when URL doesn't supply one). Inbound X-Request-ID is accepted only if it matches ^[A-Za-z0-9._:-]{1,128}$. Use when registering custom (non-WooCommerce) REST routes. Triggers on BetterRoute::router, $router->get/post/put/patch/delete/options, Rou