Skip to:
Content
Pages
Categories
Search
Top
Bottom

Two different functions that display member profile field data


  • atburi
    Participant

    @aburi

    [WP 3.5.2 / BP 1.8-beta1 / custom theme]
    Hi Everyone,

    What exactly is the difference is between:

    xprofile_get_field_data() & bp_get_member_profile_data()

    For instance, I have a customized member/home/profile/profile-loop page and early on in the code for that page I’m running a bp_has_members() loop to show friend connections of the displayed member. After that loop runs, I’m displaying profile field data manually using bp_get_member_profile_data(). (And after that, the bp_has_profile() loop runs as normal and all the other tabs like Groups, Forums, Members are as normal.)

    However, once I insert the bp_has_members() loop above my profile fields, the profile field value that I was displaying manually stop showing for fields where I used bp_get_member_profile_data() to call the value. But when I use xprofile_get_field_data(), they appear!

    Just wondering what the difference is and the benefits/best practices are for using these two functions, and why one is working in this scenario and the other not.

    Thanks!
    Alex

Viewing 1 replies (of 1 total)

  • atburi
    Participant

    @aburi

    It appears to have something to do with the user id being set in bp_has_members() and passed on to the other functions.

    If the displayed member does have friend connections and a user id is set in the bp_has_members() loop, then that ID gets passed to the bp_get_member_profile_data() and xprofile_get_field_data() functions that I’m using to retrieve profile field values after the loop.

    Funny this is, that the admin account’s profile values are populating everyone’s profile who has friended the admin account.

    Seems the problem is becoming more clear but still unsure how to solve it…

Viewing 1 replies (of 1 total)
  • The topic ‘Two different functions that display member profile field data’ is closed to new replies.
Skip to toolbar