bp_get_friend_reject_request_link

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

Description

(string) bp_get_friend_reject_request_link(); 

Returns (string)

reject-friendship URL.


Usage

  1. if ( !function_exists( 'bp_get_friend_reject_request_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-friends/bp-friends-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_friend_reject_request_link(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-friends/bp-friends-template.php  
  1. function bp_get_friend_reject_request_link() { 
  2. global $members_template; 
  3.  
  4. if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) { 
  5. $friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() ); 
  6. wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' ); 
  7.  
  8. /** 
  9. * Filters the URL for rejecting the current friendship request in the loop. 
  10. * @since 1.0.0 
  11. * @since 2.6.0 Added the `$friendship_id` parameter. 
  12. * @param string $value Reject-friendship URL. 
  13. * @param int $friendship_id ID of the friendship. 
  14. */ 
  15. return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ), $friendship_id );