Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress – get friend IDs


  • whackter
    Participant

    @muzammil1234

    Hello,

    I’m trying to setup a plugin for which I should know the current user’s id and his/her friends ids in a single variable. It needs to be done using PHP so that I can put those variables in the shortcode.

    Can someone help me with this?
    Thanks in advance 🙂

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    $current_user_id = bp_current_user_id();
    
    $the_ids = friends_get_friend_user_ids( $current_user_id );
    
    $the_ids[] = $current_user_id;
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar