Skip to:
Content

BuddyPress.org

Ticket #6597: 6597.03.patch

File 6597.03.patch, 1.1 KB (added by dcavins, 9 years ago)

Use BP_Groups_Member::delete in groups_leave_group().

  • src/bp-groups/bp-groups-functions.php

    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 ) { 
    439439                }
    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        }
    445445
    function groups_unban_member( $user_id, $group_id ) { 
    14341434function groups_remove_member( $user_id, $group_id ) {
    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 );
    14481441