wzkb_rest_route_permission
Filters the permission logic for a REST route.
Returning a boolean short-circuits the check. Returning a capability string triggers current_user_can(). Returning a callable allows custom evaluation and should return a boolean.
Type: filter
Since: 3.0.0
Source: includes/rest/class-rest-controller.php line 260
Parameters
| Type | Name | Description |
|---|---|---|
bool|string|callable|null |
$permission |
Filtered permission directive. |
string |
$route_slug |
Route identifier. |
bool |
$default_public |
Whether the route is public by default. |
Usage
add_filter( 'wzkb_rest_route_permission', function($permission, $route_slug, $default_public) {
// ...
return $permission;
} );