Skip to:

Show pending friend requests

  • Do you know if it’s possible to show the number of pending friend requests, just the way it shows up on the Friends nav-bar? I just want to print this number somewhere else, beside the Friends nav-bar. [e.g. Requests(x)]

    I tried to replicate what the “friends_setup_nav” function does ( but I couldn’t make it work.

    Any help would be much appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of Roger Coathup
    Roger Coathup


    Use the function: bp_friend_total_requests_count()

    It’s in the file bp-friends-templatetags.php

    Thanks a lot Roger! It worked like a charm :) I knew it was simple, but I couldn’t find the right function.

    Avatar of Roger Coathup
    Roger Coathup


    @jimhellas – yes, I find myself using “find in files” a lot in my editor :-)

    Finding time to write sections on the API in the documentation is step 2!

    Avatar of murasaki


    ok , i have a similar question, how can i use an if statement to show if a request is pending? like, this:

    `if (bp_is_friends() )
    //then this
    else if ( -this is the pending part )
    // pending
    // this `

    how would i do that? i bet tis waaaay more simple than im guessing lol

    Avatar of msullens88


    @murasaki – this is the code I used to show either “(3) Friends” or just “Friends” based on how many requests that users has on there profile page.


  • <a href="/members/user_login; ?>/friends”>Friends
  • <a href="/members/user_login; ?>/friends”>()  Friends
  • `

    and you can do the same thing with Messages


  • <a href="/members/user_login; ?>/messages/inbox”>Messages
  • <a href="/members/user_login; ?>/messages/inbox”>()  Messages
  • `

    hope this helps.

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

You must be logged in to reply to this topic.