Changeset 13437 for trunk/src/bp-groups/actions/create.php
- Timestamp:
- 03/18/2023 09:42:31 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/actions/create.php
r13177 r13437 18 18 19 19 // If we're not at domain.org/groups/create/ then return false. 20 if ( ! bp_is_groups_component() || !bp_is_current_action( 'create' ) )20 if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) { 21 21 return false; 22 23 if ( !is_user_logged_in() ) 22 } 23 24 if ( ! is_user_logged_in() ) { 24 25 return false; 25 26 if ( !bp_user_can_create_groups() ) { 26 } 27 28 if ( ! bp_user_can_create_groups() ) { 27 29 bp_core_add_message( __( 'Sorry, you are not allowed to create groups.', 'buddypress' ), 'error' ); 28 bp_core_redirect( bp_get_groups_directory_ permalink() );30 bp_core_redirect( bp_get_groups_directory_url() ); 29 31 } 30 32 … … 199 201 do_action( 'groups_group_create_complete', $bp->groups->new_group_id ); 200 202 201 bp_core_redirect( bp_get_group_ permalink( $bp->groups->current_group ) );203 bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) ); 202 204 } else { 203 205 /** … … 314 316 function groups_action_sort_creation_steps() { 315 317 316 if ( ! bp_is_groups_component() || !bp_is_current_action( 'create' ) )318 if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) { 317 319 return false; 320 } 318 321 319 322 $bp = buddypress(); 320 323 321 if ( ! is_array( $bp->groups->group_creation_steps ) )324 if ( ! is_array( $bp->groups->group_creation_steps ) ) { 322 325 return false; 326 } 323 327 324 328 foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) { 325 while ( ! empty( $temp[$step['position']] ) )329 while ( ! empty( $temp[$step['position']] ) ) { 326 330 $step['position']++; 327 328 $temp[$step['position']] = array( 'name' => $step['name'], 'slug' => $slug ); 331 } 332 333 $temp[ $step['position'] ] = array( 334 'rewrite_id' => $step['rewrite_id'], 335 'name' => $step['name'], 336 'slug' => $slug, 337 ); 329 338 } 330 339 331 340 // Sort the steps by their position key. 332 ksort($temp); 333 unset($bp->groups->group_creation_steps); 334 335 foreach( (array) $temp as $position => $step ) 336 $bp->groups->group_creation_steps[$step['slug']] = array( 'name' => $step['name'], 'position' => $position ); 341 ksort( $temp ); 342 unset( $bp->groups->group_creation_steps ); 343 344 foreach( (array) $temp as $position => $step ) { 345 $bp->groups->group_creation_steps[ $step['slug'] ] = array( 346 'rewrite_id' => $step['rewrite_id'], 347 'default_slug' => $step['slug'], 348 'name' => $step['name'], 349 'position' => $position 350 ); 351 } 337 352 338 353 /**
Note: See TracChangeset
for help on using the changeset viewer.