Filters
| Filter | Arguments | Purpose |
|---|---|---|
lh_contacts_init_plugin |
bool $init |
Return false to stop LH Contacts booting. |
lh_contacts_return_view_capability |
string $capability |
The capability to see member contacts (default publish_posts). |
lh_contacts_add_data |
array $data, int $user_id, int $viewer_id |
A card’s fields before it is serialised. See Card data below for the keys. |
lh_contacts_return_all_tracked_meta_fields |
array $keys |
User meta keys whose change marks the card changed (default nickname, first and last name, biography). |
lh_contacts_return_photo_size |
int $size |
Card photo size in pixels (default 256). |
lh_contacts_block_taxonomy |
string $taxonomy |
The user taxonomy holding blocks (default lh_bp_bms_block_status, term blocked). |
lh_contacts_download_link_lifetime |
int $seconds |
How long a download link works (default a day). |
lh_contacts_recently_updated_item |
string $html, WP_User $user |
One entry in the Recently Updated Contacts list. |
lh_contacts_member_query_args |
array $args |
The get_users() arguments for the member book. fields is always forced to ID, and blocked users are removed afterwards. |
lh_contacts_return_members_collection_id |
string $id |
The member book’s collection ID in its URL (default members). Changing it on a live site makes phones lose the existing book. |
Card data
The array passed through lh_contacts_add_data is a public contract. Since 0.4.0 its keys have no vcard_ prefix, and phones and addresses are lists, so a card can hold any number of each. Add to a list rather than replacing it, so other plugins’ entries survive.
| Key | Value |
|---|---|
first_name, last_name, full_name
|
Strings. |
emails |
A string, or an array with the primary address first. |
phones |
A list of array( 'number' => E.164, 'types' => array, 'pref' => bool ). Types are any of cell, home, work, fax, voice (voice if none). The first number with pref is written first with TYPE=PREF; a number appearing twice is written once. Since 0.5.0 an entry may also have 'label', a custom label such as WhatsApp (plain text, up to 40 characters), written as a grouped itemN.TEL with itemN.X-ABLABEL; iPhone Contacts shows it in place of the standard label. LH Phone Numbers sets it for a member’s WhatsApp number that is not their primary. |
addresses |
A list of array( 'types' => array of home or work, 'street', 'city', 'state', 'postcode', 'country' ). Empty addresses are dropped; home if no type. |
organisation, title
|
Strings; organisation defaults to the site name. |
teams |
A list of array( 'name', 'url' ). |
categories |
An array of names, or a comma list. |
work_url, profile_url
|
URLs. |
birthday, gender, note, photo
|
birthday as Y-m-d, photo as a URL. |
uid, rev
|
Set by LH Contacts. |
Shortcode
shows members whose cards changed in the last two weeks, with download links. Empty for users without the capability.
REST route
GET /wp-json/lh-contacts/v1/download?user_ids=…&token=… serves the cards for a signed link (see Architecture).
Stored data
- User meta
{site prefix}lh_contacts-updated_time: each card’s last-changed time per site. - Option
lh_contacts-schema_version(per site) and transientlh_contacts-recently_updated. - Cron event
lh_contacts_backfill_updated_times, scheduled once per site.
Hooks used
-
lh_dav_collection_providers(LH DAV): adds the member book provider. - User, BuddyPress profile, avatar, group membership, group save and block-status term events: card change tracking.
-
lh_phone_numbers_links_changed(LH Phone Numbers): a member’s numbers, primary or a number’s channels changed, so their card is marked changed. -
lh_addresses_saved,lh_addresses_replacedandlh_addresses_use_ended(LH Addresses, since 0.6.0): one of a member’s addresses was saved, replaced or a use of it ended, so their card is marked changed, once per request. -
user_row_actions,ms_user_row_actions,bp_member_options_nav,bp_group_options_nav,lh_bg_reports_fields,lh_bg_reports_field_output,bbp_theme_after_reply_author_admin_detailsand LH Buddypress Check Ins’ table hooks: download links. - LH Profile Page’s
…_search_users_result_propertiesand…_search_users_results:vcard_urlin search-users.

