bp_is_first_group_creation_step( string $step = '' )
Is the user looking at the first step in the group creation process
Description
Parameters
- $step
-
(Optional) Step to compare.
Default value: ''
Return
(bool) True if yes, False if no
Source
File: bp-groups/bp-groups-template.php
function bp_is_first_group_creation_step( $step = '' ) {
// Use current step, if no step passed.
if ( empty( $step ) ) {
$step = bp_get_groups_current_create_step();
}
// Get the first step.
$bp = buddypress();
$steps = array_keys( $bp->groups->group_creation_steps );
$f_step = array_shift( $steps );
// Compare first step to step.
$retval = ( $f_step === $step );
/**
* Filters whether or not user is looking at first step in group creation process.
*
* @since BuddyPress 2.4.0
*
* @param bool $retval Whether or not we are looking at first step.
* @param array $steps Array of steps from the group creation process.
* @param string $step Step to compare.
*/
return (bool) apply_filters( 'bp_is_first_group_creation_step', $retval, $steps, $step );
}
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.