Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get Buddypress Profile Data in WordPress Page


  • linish
    Participant

    @linish

    Hello All,

    I am new to buddy press. Currently I am working in a site which consists of Directory Press + S2Member + BuddyPress. My aim is to retrieve the value from buddypress profile fields on profile activation. Everything went fine till try to get the data from the profile field in buddy press

    When I searched the documentation says us to use the function `bp_profile_field_data`

    The following code works fine in the file profile-loop.php

    `bp_member_profile_data( ‘field=Company Name’ )`

    But when I use the same code in functions.php it shows blank

    Thanks
    Linish

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

  • shanebp
    Moderator

    @shanebp

    Use :
    xprofile_get_field_data( “Company Name” , $member_id)
    You have to supply the $member_id

    If you’re on a profile page, the $member_id will be provided via bp_displayed_user_id()

    Take a look at
    /bp-xprofile/ -> bp-xprofile-functions.php -> xprofile_get_field_data


    linish
    Participant

    @linish

    Hello,

    I had tried that but it will worked only on buddypress profile page, the same gave blank result in normal wordpress page / custom template for a page


    shanebp
    Moderator

    @shanebp

    xprofile_get_field_data function is provided so that you CAN use it on non-profile pages.

    Use http://pastie.org/ or similar to show what you tried.


    linish
    Participant

    @linish

    Hello,

    I had created the paste of the code i had tried both in profile-loop.php and in

    functions.php

    `http://pastie.org/6050342`

    The code is working fine in profile-loop.php but showing blank result in

    functions.php


    linish
    Participant

    @linish

    Hello all,

    I solved the issue by using the hook `wpmu_activate_user`

    Thanks for the tips 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get Buddypress Profile Data in WordPress Page’ is closed to new replies.
Skip to toolbar