Skip to:
Content

BuddyPress.org


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-actions.php

    r5203 r4961  
    244244    // User wants to leave any group
    245245    if ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
    246 
    247         // Stop sole admins from abandoning their group
    248         $group_admins = groups_get_group_admins( $bp->groups->current_group->id );
    249         if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $bp->loggedin_user->id )
    250             bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' );
    251 
    252         elseif ( !groups_leave_group( $bp->groups->current_group->id ) )
     246        if ( !groups_leave_group( $bp->groups->current_group->id ) ) {
    253247            bp_core_add_message( __( 'There was an error leaving the group.', 'buddypress' ), 'error' );
    254         else
     248        } else {
    255249            bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) );
    256 
     250        }
    257251        bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
    258252    }
Note: See TracChangeset for help on using the changeset viewer.