aam_rest_role_output_filter
Purpose
Change a role REST response.
Callback
- Type: Filter.
- Arguments:
$response,$role,$fields. - Return: the filtered first argument.
Example
add_filter('aam_rest_role_output_filter', function ($response, $role, $fields) {
$response['myapp_label'] = $role->name;
return $response;
}, 10, 3);
Adds a readable role label to the REST output while preserving existing fields.
See the complete hook list.