bp_are_previous_group_creation_steps_complete

The BuddyPress bp are previous group creation steps complete function.

Description

bp_are_previous_group_creation_steps_complete( (string) $step_slug ); 

Parameters (1)

0. $step_slug (string)
The step slug.

Usage

  1. if ( !function_exists( 'bp_are_previous_group_creation_steps_complete' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // The step slug. 
  5. $step_slug = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_are_previous_group_creation_steps_complete($step_slug); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-groups/bp-groups-template.php  
  1. function bp_are_previous_group_creation_steps_complete( $step_slug ) { 
  2. $bp =buddypress); 
  3.  
  4. // If this is the first group creation step, return true. 
  5. $keys = array_keys( $bp->groups->group_creation_steps ); 
  6. if ( array_shift( $keys ) == $step_slug ) { 
  7. return true; 
  8.  
  9. reset( $bp->groups->group_creation_steps ); 
  10.  
  11. $previous_steps = array(); 
  12.  
  13. // Get previous steps. 
  14. foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) { 
  15. if ( $slug === $step_slug ) { 
  16. break; 
  17.  
  18. $previous_steps[] = $slug; 
  19.  
  20. return bp_is_group_creation_step_complete( $previous_steps );