---
title: Hooks Reference
url: https://lhero.org/portfolio/lh-profile-page/hooks-reference/
date: 2026-09-09T01:46:13+10:00
modified: 2026-12-01T11:47:16+11:00
type: lh-portfolio-doc
---

- **Part of:** [LH Profile Page](https://lhero.org/portfolio/lh-profile-page/)

# Hooks Reference

All registered in `plugin_init()` unless noted. This plugin integrates with a large number of other `lh-` plugins – grouped by what they connect to.

## Registered meta (see Database Schema for details)

`register_meta()` is called on `init` for gender, birthdate, and all five address fields, each via its own field class's `register_meta_fields()`. The phone keys stopped being registered in 3.30.4: phone numbers live in LH Phone Numbers. The address keys are legacy too: addresses live in LH Addresses, and since LH Addresses 0.11.0 the keys are no longer kept up to date.

## User edit / save lifecycle

- `show_user_profile` / `edit_user_profile` -&gt; `add_backend_profile_fields()`
- `personal_options_update` / `edit_user_profile_update` / `user_register` -&gt; `save_backend_profile_profile_fields()`
- `wp` -&gt; `save_data()` -&gt; `post_handler()` (frontend form POST handling)
- `updated_user_meta` / `added_user_meta` -&gt; `track_last_meta_update_time()` (address saves no longer write the meta, so they no longer reach this)
- `add_user_metadata` -&gt; `prevent_bad_meta_values()` (rejects empty writes to non-native fields)

## BuddyPress

- `bp_xprofile_get_field_types` -&gt; `add_field_types()`
- `xprofile_get_field_data` / `bp_get_the_profile_field_value` -&gt; override to read the real values (user meta, phone numbers from LH Phone Numbers, addresses from LH Addresses) instead of `bp_xprofile_data`
- `bp_after_has_profile_parse_args` -&gt; `intercept_profile_query_args()` (excludes the native Name field from the xprofile loop)
- `get_avatar` / `bp_core_fetch_avatar` / `bp_core_fetch_avatar_url` -&gt; gender-based fallback avatar images
- `bp_xprofile_new_avatar_action` -&gt; gendered pronoun text ("changed his/her profile picture")

## "Users Insights" plugin integration

- `usin_fields` / `usin_db_map` / `usin_query_join_table` (the original Users Insights) and, since 3.32.0, `lh_ui_fields` / `lh_ui_db_map` / `lh_ui_query_join_table` (LH User Insights), which take the same arguments, so the fields show in both while they run in parallel. On each set, both this class's own `register_fields()`/`filter_db_map()`/`filter_query_joins()` (address group, joining LH Addresses' tables through `own_residential_subquery()` since 3.25.1; gender and birthdate join usermeta) and `LH_Profile_Phone_Field`'s equivalents (phone group) are hooked separately, since they can't be merged into one callback (see Field Class Architecture). Since 3.31.0 the phone group joins LH Phone Numbers' tables: Phone is a user's first current number and Secondary Phone their second, primary first then oldest link, as `return_user_phone()`.

## LH Check-Ins / Log Entry integration

- `lh_bp_check_ins_check_if_can_check_in` / `lh_bp_log_entry_check_if_can_check_in` -&gt; `force_to_unknown()` (routes to the "unknown user" flow if gender/phone/birthdate are missing)
- `lh_bp_check_ins_form_unknown` / `lh_bp_log_entry_form_unknown` -&gt; `add_fields_to_form_unknown()`
- `lh_bp_check_ins_activity_added` / `lh_bp_log_entry_activity_added` / `*_user_recognised` -&gt; `maybe_add_user_data_on_activity_add()` / `maybe_add_user_data_on_user_recognised()` -&gt; `maybe_do_user_update()`
- `{namespace}_user_table_header_after` / `*_row_after` (conditional on `LH_Buddypress_check_ins_plugin` existing) -&gt; adds mobile/gender columns to check-in reports

## LH CRM / Group Invites

- `lh_crm_http_post_after_user` / `lh_bgr_http_post_after_user` -&gt; `new_user_update()` (a near-duplicate of `post_handler()`/`maybe_do_user_update()` – see Field Class Architecture's note on unconsolidated orchestrator methods)
- `lh_crm_send_notification_tokens` -&gt; `add_notification_tokens()`

## CSV import and export

- `lh_iubc_result_handle_new_user_success` / `lh_iubc_result_exists` -&gt; `maybe_add_details_when_csv_is_uploaded()`
- `lh_eutc_value` (LH Export Users to CSV 1.0.2+) -&gt; `filter_csv_export_value()` (the phone columns come from LH Phone Numbers)

## LH Buddypress Group Reports

- `lh_bg_reports_fields` -&gt; `add_new_report_fields()` (the Birthdate column is added only when `user_can_view_report_birthdates()` passes, so group admins and moderators don't get it)
- `lh_bg_reports_field_output` -&gt; `format_report_fields()` (formats birthdate as `d-m-Y` and phone as clickable tel/sms links)

## LH Contacts

Registered at file level in `includes/lh-profile-vcard-integration-class.php` (`LH_Profile_Vcard_Integration`). Until 3.10.5 these hooked LH Vcard’s `lh_vcard_*` filters; LH Contacts replaced LH Vcard. Phone numbers on cards come from LH Phone Numbers, not here.

- `lh_contacts_add_data` -&gt; `add_vcard_data()` (gender, birthday and home address on contact cards; the address read from LH Addresses)
- `lh_contacts_return_all_tracked_meta_fields` -&gt; `add_vcard_tracking()` (this plugin’s profile fields, less the phone and address keys, mark the card changed; since 3.26.2 LH Contacts follows LH Addresses' actions for addresses, as it follows LH Phone Numbers for phones)

## LH Add User

- `lh_add_user_page_after_email` -&gt; `add_additional_inputs()` (adds phone + gender fields to the add-user flow)
- `lh_add_user_page_after_user_insertion` -&gt; `maybe_add_values_to_user()`

## Search &amp; user list

In `includes/lh-profile-admin-users-class.php` (`LH_Profile_Admin_Users`).

- `user_search_columns` / `pre_user_query` -&gt; `add_search_columns()` / `add_search_joins()` (the Users screen search also matches every current phone number in LH Phone Numbers, and additional emails; filter `lh_profile_return_searchable_fields`)
- `pre_get_users` -&gt; `modify_user_list()` (filter users list by gender query param)
- `manage_users_columns` / `manage_users_custom_column` / `default_hidden_columns` -&gt; gender/emails admin columns

## Filters this plugin exposes for other plugins to hook

- `lh_profile_return_plugin_debugging_status` – gate for `write_log()` output (defaults `true`)
- `lh_profile_birthdate_minimum_age_years` – added v2.14, lets another plugin (intended: LH Membership) restrict the birthdate input's client-side `max` date to enforce a minimum age. Defaults `0` (no restriction). See Architectural Notes.
- `lh_profile_user_can_view_report_birthdates` – added v3.11.2, decides who gets the Birthdate column in LH Buddypress Group Reports. Receives the default, `current_user_can( 'promote_users' )`, and the group ID.
- `lh_profile_return_ambiguous_first_names` / `lh_profile_return_gender_check_countries` – added v3.28.0, the ambiguous first names and the check countries used by `LH_Profile_First_Name_Gender::suggest()`. See First-name gender lookup.
- `lh_profle_return_required_fields` / `lh_profle_has_required_fields` – customise which fields count as "required" for `has_required_fields()`