Skip to:
Content
Pages
Categories
Search
Top
Bottom

Can’t get facebook profile link


  • gboyer20
    Participant

    @gboyer20

    I am using

    $dmember_id = $bp->displayed_user->id;
    $fb_info = xprofile_get_field_data(‘Facebook’, $dmember_id);

    but I don’t get any information even when that field is populated, Could anyone help me to identify what’s wrong?

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

  • shanebp
    Moderator

    @shanebp

    If you are on a profile page, try: $dmember_id = bp_displayed_user_id();


    gboyer20
    Participant

    @gboyer20

    Thanks @shanebp, but I think I’m not getting the right id, it should match with WordPress user id?


    shanebp
    Moderator

    @shanebp

    BP uses the WP user id.
    Share the context of your code.


    gboyer20
    Participant

    @gboyer20

    So it isn’t giving me the right id.
    I’m trying to show the social icons with the link to the social profile, the icon will be black if is set, or gray if isn’t


    shanebp
    Moderator

    @shanebp

    Again – in what context? What page? What hook?
    If you don’t provide basic info, responders can only guess.


    gboyer20
    Participant

    @gboyer20

    I had not understood the question, I’m trying to add it on a custom profile page. I was able to make it work with xprofile_get_field_data(‘Social Profiles’, get_current_user_id()).

    One question, is possible to add new social networks to that section?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar