groups_action_sort_creation_steps()
Sort the group creation steps.
Description
Return
(false|null) False on failure.
Source
File: bp-groups/actions/create.php
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.