aam_rest_route_args_filter
Purpose
Return the route definition before it is passed to WordPress. The hook runs for routes registered through AAM’s REST utility.
Callback
- Type: Filter.
- Arguments:
$args(route definition),$route(path),$ns(namespace). - Return: the filtered first argument.
Example
add_filter('aam_rest_route_args_filter', function ($args, $route, $ns) {
if ($ns === 'aam/v2' && $route === '/urls') {
$args['show_in_index'] = false;
}
return $args;
}, 10, 3);
This omits the URLs route from the REST index while leaving the route available and other routes unchanged.
See the complete hook list.