Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/14/2015 06:24:29 PM (9 years ago)
Author:
dcavins
Message:

Modify delete method in groups_leave_group().

Using groups_remove_member() in
groups_leave_group() led to confusion
in the action hooks that are called.
This change reverts the change in r9811
to avoid this problem.

Props thebrandonallen, r-a-y.

Fixes #6597.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-functions.php

    r10148 r10278  
    440440    }
    441441
    442     if ( ! groups_remove_member( $user_id, $group_id ) ) {
     442    if ( ! BP_Groups_Member::delete( $user_id, $group_id ) ) {
    443443        return false;
    444444    }
     
    14351435
    14361436    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    }
    14461439
    14471440    $member = new BP_Groups_Member( $user_id, $group_id );
Note: See TracChangeset for help on using the changeset viewer.