add-group-members Add Group Membersremove-group-members Remove Group Membersset-group-member-role Set Group Member RoleAdds users to a BuddyPress group through BuddyPress, so group hooks run, and reports the outcome per user. A pending membership request or invitation is accepted rather than duplicated (BuddyPress fires its usual accept actions); otherwise the user joins with groups_join_group. role makes new members mods or admins; existing members are reported as already_member with their role unchanged (use set-group-member-role). Only members of the site the call runs on (the connector's site, or site_id) can be added: with LH Membership, approved members only. The site's own rules come first: they can refuse any join through the lh_mcp_buddypress_actions_refuse_change filter, and a real run is refused while the site has plugins this call did not load (a site_id call from another site), so use that site's own connector. Statuses: added, would_add (dry run), already_member, banned (left banned), not_site_member, not_found (no such user, or spam or deleted) and refused (a site rule, BuddyPress or a join hook turned it down, or an unconfirmed membership row exists). Callers with install_plugins are not restricted: the site member requirement, site rules and the refusal for unloaded site plugins are skipped, and warnings still say when site plugins were not loaded. dry_run defaults to true. note is recorded in LH Audit Trail with each join. Requires bp_moderate, or being an admin of the group. Pass site_id to act on another site you belong to.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
group_id | integer | Yes | The BuddyPress group ID. | |
user_ids | array of integer | Yes | WordPress user IDs to act on, at most 100. | |
dry_run | boolean | No | true | Default true: report what would happen and change nothing. Pass false to make the change. |
note | string | No | Optional. Why this was done, recorded with each change in LH Audit Trail. | |
role | string | No | "member" | Role for users who are added: member (default), mod or admin. Existing members keep their role. One of: member, mod, admin. |
task_id | integer | No | Optional. The lh-tasks task this call is working on. Pass with claim_token: the call is refused unless you hold that claim, and a successful call renews it. | |
claim_token | string | No | Optional. The claim_token from claim-next-task for task_id. Required when task_id is given. | |
site_id | integer | No | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
Removes or bans users from a BuddyPress group through BuddyPress, so group hooks run, and reports the outcome per user. Uses groups_remove_member, or groups_ban_member with ban. Never leaves a group without an admin: removing or banning its last admin is refused, and a group admin must be demoted with set-group-member-role before being banned. Statuses: removed, banned, would_remove and would_ban (dry run), not_member, already_banned, not_found (no such user, or spam or deleted), refused (last admin, an admin to ban, a site rule, or BuddyPress turned it down). The site's own rules come first: they can refuse any change through the lh_mcp_buddypress_actions_refuse_change filter, and a real run is refused while the site has plugins this call did not load (a site_id call from another site), so use that site's own connector. Callers with install_plugins are not restricted: site rules and the refusal for unloaded site plugins are skipped, and warnings still say when site plugins were not loaded. dry_run defaults to true. note is recorded in LH Audit Trail with each change. Requires bp_moderate, or being an admin of the group. Pass site_id to act on another site you belong to.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
group_id | integer | Yes | The BuddyPress group ID. | |
user_ids | array of integer | Yes | WordPress user IDs to act on, at most 100. | |
dry_run | boolean | No | true | Default true: report what would happen and change nothing. Pass false to make the change. |
note | string | No | Optional. Why this was done, recorded with each change in LH Audit Trail. | |
ban | boolean | No | false | Ban instead of remove, so the user cannot rejoin. Default false. |
task_id | integer | No | Optional. The lh-tasks task this call is working on. Pass with claim_token: the call is refused unless you hold that claim, and a successful call renews it. | |
claim_token | string | No | Optional. The claim_token from claim-next-task for task_id. Required when task_id is given. | |
site_id | integer | No | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
Promotes or demotes existing members of a BuddyPress group between member, mod and admin, and reports the outcome per user. Goes through BuddyPress (groups_promote_member and groups_demote_member), so group hooks run. Only confirmed, unbanned members change; it never adds anyone (use add-group-members). Demoting the group's last admin is refused. Statuses: changed, would_change (dry run), unchanged (already that role), not_member, banned, not_found (no such user, or spam or deleted) and refused (last admin, a site rule, or BuddyPress turned it down). The site's own rules come first: they can refuse any change through the lh_mcp_buddypress_actions_refuse_change filter, and a real run is refused while the site has plugins this call did not load (a site_id call from another site), so use that site's own connector. Callers with install_plugins are not restricted: site rules and the refusal for unloaded site plugins are skipped, and warnings still say when site plugins were not loaded. dry_run defaults to true. note is recorded in LH Audit Trail with each change. Requires bp_moderate, or being an admin of the group. Pass site_id to act on another site you belong to.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
group_id | integer | Yes | The BuddyPress group ID. | |
user_ids | array of integer | Yes | WordPress user IDs to act on, at most 100. | |
dry_run | boolean | No | true | Default true: report what would happen and change nothing. Pass false to make the change. |
note | string | No | Optional. Why this was done, recorded with each change in LH Audit Trail. | |
role | string | Yes | The role to set: member, mod or admin. One of: member, mod, admin. | |
task_id | integer | No | Optional. The lh-tasks task this call is working on. Pass with claim_token: the call is refused unless you hold that claim, and a successful call renews it. | |
claim_token | string | No | Optional. The claim_token from claim-next-task for task_id. Required when task_id is given. | |
site_id | integer | No | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |