learndash/manage-group-leaders adds or removes the users who lead a group.
Two things about leaders surprise people.
At a glance
| Ability | learndash/manage-group-leaders |
| Toolset | LearnDash — toolset/learndash |
| Group | LearnDash › Groups |
| Requires | AcrossAI Pro, plus LearnDash LMS active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Pro 0.9.16 and later |
How it works
The first is that leading a group does not grant the leader the group’s course access. A leader who should also take the courses needs adding as a member too, through learndash/manage-group-membership.
That separation is correct — a manager overseeing a cohort is not necessarily a learner in it — and it routinely produces a leader who cannot open the course they are managing.
The second is the role. A leader normally needs the group_leader role to use their permissions at all, and adding somebody without it produces a leader who is recorded as one and can do nothing. The response warns when that happens.
This is incremental. Pass add and remove as arrays; anything you do not mention is left alone. That makes a single change a single call, and it means a caller cannot wipe a list by sending a short one.
What a leader may actually do beyond that is site settings rather than anything set here, so two sites with identical leader lists can behave very differently.
Idempotent.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
group_id | integer | Yes | The group. |
add | array | No | User IDs, logins or emails to make leaders. |
remove | array | No | User IDs, logins or emails to remove as leaders. |
What comes back
| Name | Type | What it is |
|---|---|---|
leaders | array | The leaders afterwards. |
warnings | array | Anybody added without the group_leader role. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Make this person a leader of the cohort.
It resolves to one call:
{
"ability": "learndash/manage-group-leaders",
"parameters": {
"group_id": 700,
"add": ["manager@example.com"]
}
}Worth knowing
- Leading does not grant course access. Add them as a member too if they need it.
- Without the
group_leaderrole the permissions do not apply — and you are warned. - What a leader may do is site settings, not this call.
- Incremental.
Related abilities
- LearnDash List Group Leaders — the current leaders
- LearnDash Manage Group Membership — give a leader course access too
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category