Digital Sovereignty for everyone

MCP Abilities

Agents can read and set members’ numbers without wp-admin. Both number abilities take site_id, and a group admin (a team captain) can use them for their own group as well as anyone with bp_moderate. Changes made with set-group-number are recorded in LH Audit Trail when it is active.

Get Group Numbers

lh-buddypress-group-numbers/get-group-numbers Read-only Idempotent

Returns members’ numbers per BuddyPress group, such as shirt numbers, by user or for a whole group, flagging duplicates. Pass user_ids for those users’ numbers in every group (only in group_id when it is also given), or group_id alone to list every current member of that group with their number, null when they have none. Each number comes with its group’s name and duplicate_user_ids, the other current members of that group holding the same number; duplicates sums these up per group and number. Numbers are read as the profile form reads them, so legacy lh-competitions numbers still show until the migration is finalised. Group mode lists confirmed members only, not invitees. Call set-group-number to change a number. Requires bp_moderate, or being an admin of group_id, which then limits the result to that group. Pass site_id to act on another site you belong to.

Parameter Type Required Default Description
user_ids array of integer No WordPress user IDs whose numbers to return.
group_id integer No BuddyPress group ID. Alone, lists every current member of the group; with user_ids, limits their numbers to this group.
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.
run_without_site_plugins boolean No Optional, with site_id. Run the call through this connector even when that site has plugins of its own that cannot be loaded for it. Without this, such a write is refused if it cannot be run on that site itself.

Migrate Group Numbers

lh-buddypress-group-numbers/migrate-group-numbers Destructive Idempotent

Moves group numbers off lh-competitions’ legacy keys: report (default) changes nothing and gives counts; migrate retypes every site’s legacy xProfile fields and copies one batch of user meta to the new key, and is safe to repeat until users_to_copy is 0; finalise deletes the legacy user meta and ends the legacy fallback, and is refused while anything is left to move. Requires install_plugins; main site only.

Parameter Type Required Default Description
mode string No "report" report (dry run), migrate (one batch) or finalise. One of: report, migrate, finalise.
batch_size integer No 500 Users to copy per migrate run.
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.

Set Group Number

lh-buddypress-group-numbers/set-group-number Idempotent

Sets or clears one member’s number in one BuddyPress group, such as a shirt number, and returns it before and after. Only that group’s number changes; the member’s numbers in other groups are kept, and the value goes through the plugin’s own range and sanitising, as the profile form does. Pass number null to clear it. Refused when the user is not a member of the group, current or invited (as the profile form decides who gets an input), or when the number is out of range. When other current members of the group already hold the number it is still set, with a warning naming them in duplicate_user_ids. A change is recorded in LH Audit Trail, with note when given; setting the number a member already has changes nothing. Call get-group-numbers to check a whole group. 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
user_id integer Yes The member’s WordPress user ID.
group_id integer Yes The BuddyPress group ID.
number integer|null Yes The number, 0 to 999, or null to clear it.
note string No Optional. Why the number was set, recorded with the change in LH Audit Trail.
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.
run_without_site_plugins boolean No Optional, with site_id. Run the call through this connector even when that site has plugins of its own that cannot be loaded for it. Without this, such a write is refused if it cannot be run on that site itself.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.