aam_rest_role_output_filter

Purpose

Change a role REST response.

Callback

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.