Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing Display Name with other field from database


  • phos flip
    Participant

    @wamoma

    Hello – I am using woocommerce fields for registration and would like to use the ‘company_name’ field from woocommerce as the main display name in Buddypress (on profile and members list etc.)

    Rather than hack different template files I was hoping to create a function that would replace the existing ‘bp_displayed_user_fullname’ with the woocommerce ‘shipping_company’

    I’ve tried various ways but ultimately failed so am hoping somebody might be able to point me in the right direction? please!! 🙂

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    Use this filter hook:

    apply_filters( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' );

    See function bp_get_displayed_user_fullname() in this file
    bp-members/bp-members-template.php

Viewing 1 replies (of 1 total)
  • The topic ‘Changing Display Name with other field from database’ is closed to new replies.
Skip to toolbar