Changeset 9811 for trunk/src/bp-groups/bp-groups-functions.php
- Timestamp:
- 04/27/2015 07:10:10 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r9810 r9811 432 432 } 433 433 434 // This is exactly the same as deleting an invite, just is_confirmed = 1 NOT 0. 435 if ( !groups_uninvite_user( $user_id, $group_id ) ) { 434 if ( ! groups_remove_member( $user_id, $group_id ) ) { 436 435 return false; 437 436 } … … 1406 1405 function groups_remove_member( $user_id, $group_id ) { 1407 1406 1408 if ( ! bp_is_item_admin() ) 1409 return false; 1407 if ( ! bp_is_item_admin() ) { 1408 // bp_is_item_admin may not be set if this function is called outside of group context. 1409 // Site admins and group admins can remove a member from a group. 1410 // A member may also request to remove herself from a group. 1411 if ( ! current_user_can( 'bp_moderate' ) 1412 && ! groups_is_user_admin( bp_loggedin_user_id(), $group_id ) 1413 && $user_id != bp_loggedin_user_id() ) { 1414 return false; 1415 } 1416 } 1410 1417 1411 1418 $member = new BP_Groups_Member( $user_id, $group_id );
Note: See TracChangeset
for help on using the changeset viewer.