BuddyPress has no meta for invitations, so LH Membership adds it: per-invitation data such as when a reminder was sent, kept with the invitation and deleted with it.
Storage
- A table beside the invitations table BuddyPress actually uses, named from it:
BP_Invitation_Manager::get_table_name()plus_invitemeta, solhero_bp_invitations_invitemetaon LocalHero. It is in BuddyPress’s meta-table shape:id(primary key),invite_id(indexed),meta_key(indexed) andmeta_value. - The name is deliberately not built from
bp_core_get_table_prefix(). On LocalHero, LH BuddyPress Multi Network makes that prefix each site’s own, while the invitations table is kept network-wide, so the prefix would give each site its own meta table. Before 2.120.1 it did: a site’s own requests (its reminder runs among them) wrote to a per-site table, while requests reaching the site withsite_idread the network one. - Read and written with WordPress’s metadata API under the meta type
invite($wpdb->invitemeta), wrapped in BuddyPress’sbp_filter_metaid_column_nameexactly as BuddyPress’s groupmeta functions are. - Object-cached in the
invite_metagroup, registered as a global cache group, so meta reads the same from any site, including through the main connector withsite_id. - When BuddyPress deletes invitations (today only when an account is deleted), their meta is deleted with them.
Functions
Static methods on LH_Membership_organisation_team_invitations_class, with the same arguments as WordPress’s own meta functions:
add_invite_meta( $invite_id, $meta_key, $meta_value, $unique = false )get_invite_meta( $invite_id, $meta_key = '', $single = true ): an empty key returns all of the invitation’s meta.update_invite_meta( $invite_id, $meta_key, $meta_value, $prev_value = '' )delete_invite_meta( $invite_id, $meta_key = '', $meta_value = '' ): an empty key deletes all of the invitation’s meta.
They are deliberately not named bp_invitations_*_invitemeta(), so they cannot clash with BuddyBoss’s functions of that name or with any BuddyPress adds later.
Installation
The table is created with dbDelta if it is missing, once per network, keyed on the class’s schema_version() (recorded in the network option lh_membership-invitemeta_schema_version), never on the plugin version. A table that already exists with the same schema is used as it is: on LocalHero it was created earlier by BuddyBoss. If BuddyBoss is active, its own invitation meta functions are left alone; they share the table, so there is no conflict.
Filters
lh_membership_return_invite_meta_table_name( string $table ): the table.lh_membership_return_invite_meta_type( string $type ): the meta type. WordPress derives the$wpdbproperty, theinvite_idcolumn and the cache group from it, so change it only together with the table.
The code is in includes/lh-membership-organisation-team-invitations-class.php. (Since 2.113.0; table named from BuddyPress’s invitations table since 2.120.1.)

