@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-contacts/>
  a sioc:Post ;
  dc:title "Hooks and Filters" ;
  dcterms:identifier 153074 ;
  dc:modified "2026-11-01T14:15:12Z"^^xsd:dateTime ;
  dc:created "2026-11-01T12:18:31Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-contacts/hooks-and-filters/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-contacts/">LH Contacts</a></li></ul>
<h2 class="wp-block-heading">Filters</h2>



<figure class="wp-block-table"><table><thead><tr><th>Filter</th><th>Arguments</th><th>Purpose</th></tr></thead><tbody><tr><td><code>lh_contacts_init_plugin</code></td><td><code>bool $init</code></td><td>Return false to stop LH Contacts booting.</td></tr><tr><td><code>lh_contacts_return_view_capability</code></td><td><code>string $capability</code></td><td>The capability to see member contacts (default <code>publish_posts</code>).</td></tr><tr><td><code>lh_contacts_add_data</code></td><td><code>array $data, int $user_id, int $viewer_id</code></td><td>A card&#8217;s fields before it is serialised. Keys are listed in <code>LH_Contacts_Card_Builder</code>&#8216;s docblock; <code>vcard_email_address</code> may be an array with the primary address first.</td></tr><tr><td><code>lh_contacts_return_all_tracked_meta_fields</code></td><td><code>array $keys</code></td><td>User meta keys whose change marks the card changed (default nickname, first and last name, biography).</td></tr><tr><td><code>lh_contacts_return_photo_size</code></td><td><code>int $size</code></td><td>Card photo size in pixels (default 256).</td></tr><tr><td><code>lh_contacts_block_taxonomy</code></td><td><code>string $taxonomy</code></td><td>The user taxonomy holding blocks (default <code>lh_bp_bms_block_status</code>, term <code>blocked</code>).</td></tr><tr><td><code>lh_contacts_download_link_lifetime</code></td><td><code>int $seconds</code></td><td>How long a download link works (default a day).</td></tr><tr><td><code>lh_contacts_recently_updated_item</code></td><td><code>string $html, WP_User $user</code></td><td>One entry in the Recently Updated Contacts list.</td></tr><tr><td><code>lh_contacts_member_query_args</code></td><td><code>array $args</code></td><td>The <code>get_users()</code> arguments for the member book. <code>fields</code> is always forced to <code>ID</code>, and blocked users are removed afterwards.</td></tr><tr><td><code>lh_contacts_return_members_collection_id</code></td><td><code>string $id</code></td><td>The member book&#8217;s collection ID in its URL (default <code>members</code>). Changing it on a live site makes phones lose the existing book.</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Shortcode</h2>



<p class="wp-block-paragraph"><code></code> shows members whose cards changed in the last two weeks, with download links. Empty for users without the capability.</p>



<h2 class="wp-block-heading">REST route</h2>



<p class="wp-block-paragraph"><code>GET /wp-json/lh-contacts/v1/download?user_ids=…&amp;token=…</code> serves the cards for a signed link (see Architecture).</p>



<h2 class="wp-block-heading">Stored data</h2>



<ul class="wp-block-list">
<li>User meta <code>{site prefix}lh_contacts-updated_time</code>: each card&#8217;s last-changed time per site.</li>



<li>Option <code>lh_contacts-schema_version</code> (per site) and transient <code>lh_contacts-recently_updated</code>.</li>



<li>Cron event <code>lh_contacts_backfill_updated_times</code>, scheduled once per site.</li>
</ul>



<h2 class="wp-block-heading">Hooks used</h2>



<ul class="wp-block-list">
<li><code>lh_dav_collection_providers</code> (LH DAV): adds the member book provider.</li>



<li>User, BuddyPress profile, avatar, group membership, group save and block-status term events: card change tracking.</li>



<li><code>user_row_actions</code>, <code>ms_user_row_actions</code>, <code>bp_member_options_nav</code>, <code>bp_group_options_nav</code>, <code>lh_bg_reports_fields</code>, <code>lh_bg_reports_field_output</code>, <code>bbp_theme_after_reply_author_admin_details</code> and LH Buddypress Check Ins&#8217; table hooks: download links.</li>



<li>LH Profile Page&#8217;s <code>…_search_users_result_properties</code> and <code>…_search_users_results</code>: <code>vcard_url</code> in search-users.</li>
</ul>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Contacts
Filters



FilterArgumentsPurposelh_contacts_init_pluginbool $initReturn false to stop LH Contacts booting.lh_contacts_return_view_capabilitystring $capabilityThe capability to see member contacts (default publish_posts).lh_contacts_add_dataarray $data, int $user_id, int $viewer_idA card&#8217;s fields before it is serialised. Keys are listed in LH_Contacts_Card_Builder&#8216;s docblock; vcard_email_address may be an array with the primary address first.lh_contacts_return_all_tracked_meta_fieldsarray $keysUser meta keys whose change marks the card changed (default nickname, first and last name, biography).lh_contacts_return_photo_sizeint $sizeCard photo size in pixels (default 256).lh_contacts_block_taxonomystring $taxonomyThe user taxonomy holding blocks (default lh_bp_bms_block_status, term blocked).lh_contacts_download_link_lifetimeint $secondsHow long a download link works (default a day).lh_contacts_recently_updated_itemstring $html, WP_User $userOne entry in the Recently Updated Contacts list.lh_contacts_member_query_argsarray $argsThe get_users() arguments for the member book. fields is always forced to ID, and blocked users are removed afterwards.lh_contacts_return_members_collection_idstring $idThe member book&#8217;s collection ID in its URL (default members). Changing it on a live site makes phones lose the existing book.



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=…&amp;token=… serves the cards for a signed link (see Architecture).



Stored data




User meta {site prefix}lh_contacts-updated_time: each card&#8217;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.



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&#8217; table hooks: download links.



LH Profile Page&#8217;s …_search_users_result_properties and …_search_users_results: vcard_url in search-users.

""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1>, <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261101t011900-lh-contacts-hooks-and-filters> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261101t011900-lh-contacts-hooks-and-filters> rdfs:seeAlso <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261101t011900-lh-contacts-hooks-and-filters&feed=lhrdf&format=turtle> .
