aam_role_rest_field_filter

Purpose

Return a non-null value for a custom field named in the role route’s fields parameter. AAM skips null values.

Callback

Example

add_filter('aam_role_rest_field_filter', function ($value, $role, $field) {
    return $field === 'is_editor' ? ($role->slug === 'editor') : $value;
}, 10, 3);

A role request asking for fields=is_editor receives a boolean field. Other requested fields continue through the normal handler.

See the complete hook list.