groups_action_sort_creation_steps()
Sort the group creation steps.
Description
Return
(false|null) False on failure.
Source
File: bp-groups/actions/create.php
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | function groups_action_sort_creation_steps() { if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) ) return false; $bp = buddypress(); if ( ! is_array ( $bp ->groups->group_creation_steps ) ) return false; foreach ( ( array ) $bp ->groups->group_creation_steps as $slug => $step ) { while ( ! empty ( $temp [ $step [ 'position' ]] ) ) $step [ 'position' ]++; $temp [ $step [ 'position' ]] = array ( 'name' => $step [ 'name' ], 'slug' => $slug ); } // Sort the steps by their position key. ksort( $temp ); unset( $bp ->groups->group_creation_steps); foreach ( ( array ) $temp as $position => $step ) $bp ->groups->group_creation_steps[ $step [ 'slug' ]] = array ( 'name' => $step [ 'name' ], 'position' => $position ); /** * Fires after group creation sets have been sorted. * * @since BuddyPress 2.3.0 */ do_action( 'groups_action_sort_creation_steps' ); } |
Changelog
Version | Description |
---|---|
BuddyPress 1.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.