An organisation invitation records that someone has been invited to join a site, and optionally which team (BuddyPress group) they will play in. It replaces BuddyPress’s site invitation, and lets someone sign up for a team without being in it until their membership is approved.
LH_Membership_Organisation_Team_Invitation_Manager: item_id is the site, secondary_item_id the team, or 0 for none, and inviter_id who invited them (themselves when their own registration did).accepted 0) until the person accepts or declines the terms, then accepted (1). Open rows are the people still to follow up.lh_membership-org_invites_processed, so approving someone again does not put them back in teams they have left.All of it runs in network-activated LH Membership, so it behaves the same when approval or rejection runs for another site over MCP with site_id.
lh_membership_org_team_invite_created ( int $invite_id, int $user_id, int $group_id, int $inviter_id ): an invitation is created, or a team is added to an open one. $group_id is 0 for no team.lh_membership_org_team_invite_accepted ( BP_Invitation $invite, bool $joined ): for each invitation on approval; $joined is whether they are now in its team.lh_membership_org_team_invite_closed ( BP_Invitation $invite, string $reason ): an open invitation closed by rejected or removed_from_site.lh_membership_make_user_member_in_backend_before_email ( int $user_id ): fires during approval after roles are set and before the welcome email; teams are joined here.includes/lh-membership-organisation-team-invitations-class.php (lifecycle) and includes/lh-membership-organisation-team-invitation-manager.php (the BuddyPress invitation manager). LH_Membership_user_invitations_class reads and creates site invitations through it. (Since 2.101.0; replaces BuddyPress site invitations since 2.103.0; kept as history since 2.104.0.)