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 1 replies (of 1 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

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