Skip to:
Content
Pages
Categories
Search
Top
Bottom

Friend Requests Shortcode?!


  • sx1001
    Participant

    @sx1001

    Hi all,

    is there a shortcode for the list of open incoming friend requests (usually located under the URL mydomain.com/members/memberX/friends/requests/)? Or how can I mimic it? I want to display the list somewhere else as a small widget.

    I found that the page is build somewhere around the template file buddypress\members\single\friends.php in which again the requests list is displayed:

    bp_get_template_part( 'members/single/friends/requests' );

    I just cant figure out where exactly the whole story starts and where things are setup (list of members to display etc)?

    Can you please hint me to it? Thanks!

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

  • sx1001
    Participant

    @sx1001

    
    add_shortcode('friendship_requests', function() {
        global $bp;
        add_filter('bp_displayed_user_id', function($id) {
            return bp_loggedin_user_id();
        });
        $bp->current_action = 'requests';
        ob_start();
        bp_get_template_part('members/single/friends');
        return ob_get_clean();
    });
    

    This is a shortcode [friendship_requests] which kind of works.
    But not completely.
    For example the buttons to approve the connection request etc are missing.
    Also I have a plugin with extended friendship request message which can be added to a friendship request – it’s also NOT shown / hooked.

    E.g. in the official Loop / URL:
    loop

    With my Shortcode it looks like:
    shorcode


    FannySims
    Participant

    @fannysims

    How to stop all people from sending me friend requests ?


    KaineLabs Team
    Participant

    @kainelabsteam

    Hi @fannysims

    As best I know, people still can send a friend request as long as you still activate the “friends Connection” on BP settings.


    sx1001
    Participant

    @sx1001

    Just programm it using custom functions. Aint that hard.
    Just temporarly overwriting by using the has_capabilities hook 🙂


    Mahaprabhu
    Participant

    @mpcd108

    Buddypress has profiles. This is nice. And we can send Friend Requests.
    I see
    1. Friends
    2. Requests I received

    How do I see requests I sent for friendship ?

    thank you !

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