Digital Sovereignty for everyone

Hooks and Filters

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 transient lh_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_replaced and lh_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_details and LH Buddypress Check Ins’ table hooks: download links.
  • LH Profile Page’s …_search_users_result_properties and …_search_users_results: vcard_url in search-users.

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.