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 phone, gender, birthdate, and all five address fields, each via its own field class's register_meta_fields().

User edit / save lifecycle

  • show_user_profile / edit_user_profile -> add_backend_profile_fields()
  • personal_options_update / edit_user_profile_update / user_register -> save_backend_profile_profile_fields()
  • wp -> save_data() -> post_handler() (frontend form POST handling)
  • updated_user_meta / added_user_meta -> track_last_meta_update_time()
  • add_user_metadata -> prevent_bad_meta_values() (rejects empty writes to non-native fields)

BuddyPress

  • bp_xprofile_get_field_types -> add_field_types()
  • xprofile_get_field_data / bp_get_the_profile_field_value -> override to read real user meta instead of bp_xprofile_data
  • bp_after_has_profile_parse_args -> intercept_profile_query_args() (excludes the native Name field from the xprofile loop)
  • get_avatar / bp_core_fetch_avatar / bp_core_fetch_avatar_url -> gender-based fallback avatar images
  • bp_xprofile_new_avatar_action -> gendered pronoun text ("changed his/her profile picture")

"Users Insights" plugin integration

  • usin_fields / usin_db_map / usin_query_join_table – both this class's own register_fields()/filter_db_map()/filter_query_joins() (address group) 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).

LH Check-Ins / Log Entry integration

  • lh_bp_check_ins_check_if_can_check_in / lh_bp_log_entry_check_if_can_check_in -> 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 -> add_fields_to_form_unknown()
  • lh_bp_check_ins_activity_added / lh_bp_log_entry_activity_added / *_user_recognised -> maybe_add_user_data_on_activity_add() / maybe_add_user_data_on_user_recognised() -> maybe_do_user_update()
  • {namespace}_user_table_header_after / *_row_after (conditional on LH_Buddypress_check_ins_plugin existing) -> adds mobile/gender columns to check-in reports

LH CRM / Group Invites

  • lh_crm_http_post_after_user / lh_bgr_http_post_after_user -> 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 -> add_notification_tokens()

CSV import

  • lh_iubc_result_handle_new_user_success / lh_iubc_result_exists -> maybe_add_details_when_csv_is_uploaded()

LH Buddypress Group Reports

  • lh_bg_reports_fields -> add_new_report_fields()
  • lh_bg_reports_field_output -> format_report_fields() (formats birthdate as d-m-Y and phone as clickable tel/sms links)

LH Vcard

  • lh_vcard_add_data -> add_vcard_data()
  • lh_vcard_return_all_tracked_meta_fields -> add_vcard_tracking()

LH Add User

  • lh_add_user_page_after_email -> add_additional_inputs() (adds phone + gender fields to the add-user flow)
  • lh_add_user_page_after_user_insertion -> maybe_add_values_to_user()

Search & user list

  • pre_user_query -> extend_user_search() (adds phone/emails to admin user search)
  • pre_get_users -> modify_user_list() (filter users list by gender query param)
  • manage_users_columns / manage_users_custom_column / default_hidden_columns -> 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_profle_return_required_fields / lh_profle_has_required_fields – customise which fields count as "required" for has_required_fields()