bp_get_friend_reject_request_link()

Return the URL for rejecting the current friendship request in the loop.

Description

Return

(string) reject-friendship URL.

Source

File: bp-friends/bp-friends-template.php

680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
function bp_get_friend_reject_request_link() {
    global $members_template;
 
    if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
        $friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
        wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
    }
 
    /**
     * Filters the URL for rejecting the current friendship request in the loop.
     *
     * @since BuddyPress 1.0.0
     * @since BuddyPress 2.6.0 Added the `$friendship_id` parameter.
     *
     * @param string $value         Reject-friendship URL.
     * @param int    $friendship_id ID of the friendship.
     */
    return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id ), 'friends_reject_friendship' ), $friendship_id );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.