Skip to main content

benecaster_resolve_wall_display_name()

Canonical function for resolving the name shown on community surfaces — the Supporter Wall, [benecaster_member_thanks], and any add-on that needs to display a subscriber’s name consistently. Centralises the three-step resolution chain so calling code does not need to read user meta directly:

  1. Wall name (_benecaster_wall_display_name) — the name the subscriber has explicitly
    set for community surfaces.

  2. First + last namefirst_name and last_name from WordPress user meta,
    space-joined, when no wall name is set.

  3. WordPress display name (wp_users.display_name) — the final fallback.

Pass a prefetched row object as $prefetched when iterating a result set that already contains the required user fields to skip the extra get_userdata() call per row.