Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display ONLY non-friended persons.


  • viesii
    Participant

    @viesii

    Hello!
    I have ran into annoying problem – I cannot find out how to edit the members loop in order to output a list of people who are not the logged in persons friends.

    According to codex –

    When using a loop on a members profile use user_id=0 to show non-friends of the displayed user.

    My code begining –

    <?php if ( bp_has_members( 'user_id=0' . bp_loggedin_user_id() ) ) : ?>

    It works… BUT I just can’t figure out why – when I use user-id=0 it does the opposite what it is supposed to do – it displays ONLY friends. I tried replacing 0 with 1 or Null or != or whatver – didn’t help.

    I would be very grateful if somebody could help me out please!? 🙂

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

  • shanebp
    Moderator

    @shanebp

    According to codex –

    When using a loop on a members profile use user_id=0 to show non-friends of the displayed user.

    Where did you see that in the codex?


    shanebp
    Moderator

    @shanebp

    Use bp_get_friend_ids( bp_loggedin_user() ) to get the friend ids.

    Then use the result in the exclude parameter in bp_has_members.


    viesii
    Participant

    @viesii

    Thank you!!!

    bp_get_friend_ids( bp_loggedin_user_id() ) worked!


    viesii
    Participant

    @viesii

    Where did you see that in the codex?

    At Codex page about members loop.

    codex
    ^here.

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display ONLY non-friended persons.’ is closed to new replies.
Skip to toolbar