Skip to:
Content
Pages
Categories
Search
Top
Bottom

Getting custom profile field information in header

  • Avatar of KyleID
    KyleID
    Participant

    @kyleid

    Hi I have created some custom profile fields in BP, which I am trying to grab with PHP to send to Mixpanel in the ‘header.php’ (default theme) I have tried the bp_member_profile_data(‘field=SiteName’); but it looks like I’m calling it to early as it is completely empty. Do I have to declare something before this, am I even on the right track?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Tammie
    Tammie
    Moderator

    @karmatosed

    You need to somehow pass it the userid. Something possibly like this could work (it’s untested):

    `
    $userid = bp_core_get_userid( $username );
    bp_profile_field_data( array(‘user_id’=>$userid,’field’=>’fieldname’ ));
    `

    Avatar of nadegda881
    lebedeya
    Participant

    @nadegda881

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.