Changeset 2955
- Timestamp:
- 04/26/2010 11:57:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-groups.php
r2954 r2955 1185 1185 return false; 1186 1186 1187 // Nonce check 1188 if ( !check_admin_referer( 'groups_join_group' ) ) 1189 return false; 1190 1187 1191 // Skip if banned or already a member 1188 1192 if ( !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) && !groups_is_user_banned( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { … … 1208 1212 } 1209 1213 add_action( 'wp', 'groups_action_join_group', 3 ); 1214 1215 1216 function groups_action_leave_group() { 1217 global $bp; 1218 1219 if ( !$bp->is_single_item || $bp->current_component != $bp->groups->slug || $bp->current_action != 'leave-group' ) 1220 return false; 1221 1222 // Nonce check 1223 if ( !check_admin_referer( 'groups_leave_group' ) ) 1224 return false; 1225 1226 // User wants to leave any group 1227 if ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { 1228 if ( !groups_leave_group( $bp->groups->current_group->id ) ) { 1229 bp_core_add_message( __( 'There was an error leaving the group.', 'buddypress' ), 'error' ); 1230 } else { 1231 bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) ); 1232 } 1233 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 1234 } 1235 1236 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 1237 } 1238 add_action( 'wp', 'groups_action_leave_group', 3 ); 1239 1210 1240 1211 1241 function groups_action_sort_creation_steps() {
Note: See TracChangeset
for help on using the changeset viewer.