---
title: Reference Field Types
url: https://lhero.org/portfolio/lh-buddypress-xprofile-field-types/reference-field-types/
date: 2026-11-09T03:54:27+11:00
modified: 2026-11-09T03:54:27+11:00
type: lh-portfolio-doc
---

- **Part of:** [LH Buddypress Xprofile Field Types](https://lhero.org/portfolio/lh-buddypress-xprofile-field-types/)

Reference fields store a bare integer ID in the xProfile data table and show the target’s current name, so renames carry through automatically.

## Types

- **Group Reference** (`lh_xft-group`): stores a BuddyPress group ID. A hidden group’s name is shown only to its members and to users with `bp_moderate`.
- **Member Reference** (`lh_xft-member`): stores a user ID.

## Text fallback

Each field has an `allow_text` setting, off by default. When it is on, the field also accepts plain text, for values with no record to point at. A value made up only of digits is always treated as an ID.

## Editing

Users with `bp_moderate` get a search box that looks up groups, or members of the current site. Anyone else sees the current name and cannot change it.

## Deleted groups and members

Nothing runs when a group or member is deleted. The integer stays in the row and the lookup finds nothing, so the field shows blank. The search box shows empty for a dead reference, so the next save from it clears the value.

## Account merges

The plugin registers a handler on LH User Identity’s `lh_user_identity_merge_handlers` filter. Before the secondary account is deleted, member references to it on every site are repointed to the primary account. A reference on the primary’s own profile that points at the secondary is removed. The handler does not move the secondary account’s own profile values.

## Activation

The plugin must be network-activated. Calls that use `site_id` do not load site-activated plugins, so a field type registered by one is refused on those calls.