- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/screens/single/admin/delete-group.php
r11923 r13441 15 15 function groups_screen_group_admin_delete_group() { 16 16 17 if ( 'delete-group' != bp_get_group_current_admin_tab() ) 17 if ( 'delete-group' != bp_get_group_current_admin_tab() ) { 18 18 return false; 19 } 19 20 20 if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) ) 21 if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) ) { 21 22 return false; 23 } 22 24 23 25 $bp = buddypress(); 24 26 25 27 if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) { 28 $groups_slug = bp_get_groups_slug(); 29 $redirect = bp_loggedin_user_url( 30 array( 31 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 32 ) 33 ); 26 34 27 35 // Check the nonce first. 28 if ( ! check_admin_referer( 'groups_delete_group' ) ) {36 if ( ! check_admin_referer( 'groups_delete_group' ) ) { 29 37 return false; 30 38 } … … 40 48 41 49 // Group admin has deleted the group, now do it. 42 if ( ! groups_delete_group( $bp->groups->current_group->id ) ) {50 if ( ! groups_delete_group( $bp->groups->current_group->id ) ) { 43 51 bp_core_add_message( __( 'There was an error deleting the group. Please try again.', 'buddypress' ), 'error' ); 44 52 } else { … … 53 61 */ 54 62 do_action( 'groups_group_deleted', $bp->groups->current_group->id ); 55 56 bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );57 63 } 58 64 59 bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ));65 bp_core_redirect( $redirect ); 60 66 } 61 67
Note: See TracChangeset
for help on using the changeset viewer.