Member addresses

Addresses are stored by LH Addresses, once for the network, and each site sees only the addresses it holds (its uses). LH Addresses does not know what a member is, so LH Membership answers for it (includes/lh-membership-addresses-class.php, since 2.110.0).

Who is a member

A user holding any member-type term on the site: membership of the organisation, not an account or an editor role. Another site’s membership is read straight from that site’s own term tables, so no blog switch is needed.

Filters answered

Clubs get their members’ addresses

Since 2.111.0, when a user is given a member type on a site (set_object_terms), the site gets a residential use (filter lh_membership_return_club_address_use_type) on the member’s own residential address. A site that already holds a current residential address for them keeps it; a site holding a replaced address, i.e. a former member who rejoins, is given the current one. Leaving ends nothing.

Existing members were given the same way by a one-off job, lh_membership_address_uses_backfill: single cron events on the main site once LH Addresses’ own backfill is done, 100 members per run (filter lh_membership_return_address_uses_backfill_batch_size), site by site in ID order, under a five-minute network lock, retrying five minutes later on a failed query. Progress is in the network option lh_membership-address_uses_backfill (site_id, last_user_id, given, skipped, failed, done, completed_at). Members with no address of their own are skipped.