You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Significantly enhances the vip_block_data_api__rest_permission_callback
documentation with comprehensive authentication examples and best practices.
## New Examples Added
1. **Require Publish Capability** - Using current_user_can('publish_posts')
2. **Application Password Authentication** - WordPress 5.6+ app passwords
3. **API Key Authentication** - Custom API key validation
4. **JWT Token Authentication** - Integration with JWT plugins
5. **Combine Multiple Conditions** - OR logic for auth + IP whitelist
6. **Rate Limiting for Public Access** - Throttle public requests
7. **Time-Based Access Control** - Business hours example
## Additional Content
- Client-side usage examples for Application Passwords
- Client-side usage examples for API Key authentication
- Important caching warning callout for authenticated requests
- Practical code examples for headless WordPress applications
## Key Features Covered
- Application Passwords (WordPress 5.6+)
- Custom API key validation
- JWT token authentication
- IP whitelisting
- Combined authentication methods
- Rate limiting strategies
- Time-based access control
- Caching implications on WordPress VIP
These examples provide production-ready code for securing the Block Data API
in various scenarios from simple authentication to complex multi-condition access.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: docs/docs/hooks/filters.md
+167-1Lines changed: 167 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -276,6 +276,10 @@ Control who can access the REST API endpoint globally.
276
276
277
277
**Returns:***(bool)* - Whether to allow access to the API
278
278
279
+
:::warning Important: Caching Implications
280
+
Authenticated requests to the Block Data API will bypass WordPress VIP's built-in REST API caching. This can impact performance. Consider your caching strategy when requiring authentication.
0 commit comments