bp_get_group_member_ban_link

Generate a URL for banning a member from a group.

Description

(string) bp_get_group_member_ban_link( (int) $user_id = 0, (bool) $group = false ); 

Returns (string)

Parameters (2)

0. $user_id — Optional. (int)
ID of the member to ban. Default: current member in a member loop.
1. $group — Optional. (bool) => false
Group object. Default: current group.

Usage

  1. if ( !function_exists( 'bp_get_group_member_ban_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // ID of the member to ban. 
  5. // Default: current member in a member loop. 
  6. $user_id = -1; 
  7.  
  8. // Optional. Group object. Default: current group. 
  9. $group = false; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = bp_get_group_member_ban_link($user_id, $group); 
  13.  

Defined (1)

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

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_member_ban_link( $user_id = 0, $group = false ) { 
  2. global $groups_template; 
  3.  
  4. if ( empty( $group ) ) { 
  5. $group =& $groups_template->group; 
  6.  
  7. /** 
  8. * Filters a URL for banning a member from a group. 
  9. * @since 1.0.0 
  10. * @param string $value URL to use for banning a member. 
  11. */ 
  12. return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id, 'groups_ban_member' ) );