aam_get_parent_access_level_filter

Purpose

Override the parent of an access level.

Callback

Example

add_filter('aam_get_parent_access_level_filter', function ($parent, $level) {
    if ($level->type === 'role' && $level->get_id() === 'myapp_child') {
        return AAM::api()->role('editor');
    }
    return $parent;
}, 10, 2);

Makes the editor role the parent of one custom role. Confirm the role hierarchy cannot form a cycle.

See the complete hook list.