---
title: "Admin Interfaces &#038; Shortcodes"
url: https://lhero.org/portfolio/lh-profile-page/admin-interfaces-shortcodes/
date: 2026-09-09T01:46:10+10:00
modified: 2026-11-22T11:49:09+11:00
type: lh-portfolio-doc
---

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

# Admin Interfaces &amp; Shortcodes

## User edit screen (wp-admin)

`add_backend_profile_fields()` (hooked on `show_user_profile`/`edit_user_profile`) adds a "Profile Data" section to the standard WordPress user edit screen, visible only to users who can `edit_user` for that profile. Fields shown: phone, secondary phone, street address, town, postcode, state/province, country, gender, birthdate, additional emails. Saved via `save_backend_profile_profile_fields()` on `personal_options_update` / `edit_user_profile_update` / `user_register`.

## Frontend shortcodes

- **`[lh_profile_admin_form]`** – `admin_form_shortcode_output()`. Renders a full front-end editable form (first name, last name, phone, address, town, postcode, gender, birthdate) for the current logged-in user. Posts to `post_handler()`, hooked on the `wp` action via `save_data()`.
- **`[lh_profile_listing_table]`** – `listing_table_shortcode_output()`. A sortable table of all users (ID, display name, gender, phone, email), gated to `list_users` capability.

## BuddyPress xProfile integration

This plugin registers 9 custom BuddyPress xProfile field types (`add_field_types()`, hooked on `bp_xprofile_get_field_types`) so each of these fields can be added to a BuddyPress profile field group and rendered/edited through the normal xProfile UI, while the actual data lives outside the `bp_xprofile_data` table: plain user meta for the name, gender and birthdate fields, LH Phone Numbers for the phone, and LH Addresses for street address, town and postcode:

`lh_profile-first_name`, `-last_name`, `-display_name`, `-street_address`, `-town`, `-postcode`, `-gender`, `-birthdate`, `-phone` – each backed by its own `LH_Profile_xprofile_{field}_extender` class in `includes/`.

`override_returned_data()` and `override_returned_value()` intercept BuddyPress's normal xProfile data-fetching so these "faux" fields transparently return the real stored value (user meta, or the member's current phone number or own residential address) instead of (non-existent) `bp_xprofile_data` rows.

**No field visibility.** Because the values are not xProfile data, BuddyPress's per-field visibility does not apply to these types. Since 3.13.0 each extender class declares `public static $supported_features = array( 'allow_custom_visibility' => false );`, so BuddyPress hides the visibility settings for these fields in wp-admin, and templates that check field type support (BP LocalHero 0.1.47 and later) show no visibility control or "This field can be seen by" label on the profile edit and registration forms.

Note: `state_province` and `country` have **no** xProfile field type – they're admin-backend-only, never exposed through BuddyPress.

## Network Settings

A "Google Places API key" field is added to Network Settings (`show_network_settings()` / `save_network_settings()`), but the save handler doesn't currently persist the value anywhere – appears vestigial/incomplete.