diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
index 9cadd37..7a325c9 100644
|
|
function groups_leave_group( $group_id, $user_id = 0 ) { |
439 | 439 | } |
440 | 440 | } |
441 | 441 | |
442 | | if ( ! groups_remove_member( $user_id, $group_id ) ) { |
| 442 | if ( ! BP_Groups_Member::delete( $user_id, $group_id ) ) { |
443 | 443 | return false; |
444 | 444 | } |
445 | 445 | |
… |
… |
function groups_unban_member( $user_id, $group_id ) { |
1434 | 1434 | function groups_remove_member( $user_id, $group_id ) { |
1435 | 1435 | |
1436 | 1436 | if ( ! bp_is_item_admin() ) { |
1437 | | // bp_is_item_admin may not be set if this function is called outside of group context. |
1438 | | // Site admins and group admins can remove a member from a group. |
1439 | | // A member may also request to remove herself from a group. |
1440 | | if ( ! current_user_can( 'bp_moderate' ) |
1441 | | && ! groups_is_user_admin( bp_loggedin_user_id(), $group_id ) |
1442 | | && $user_id != bp_loggedin_user_id() ) { |
1443 | | return false; |
1444 | | } |
1445 | | } |
| 1437 | return false; |
| 1438 | } |
1446 | 1439 | |
1447 | 1440 | $member = new BP_Groups_Member( $user_id, $group_id ); |
1448 | 1441 | |