bp_get_group_creation_previous_link

Return the URL to the previous group creation step.

Description

(string) bp_get_group_creation_previous_link(); 

Returns (string)


Usage

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

Defined (1)

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

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_creation_previous_link() { 
  2. $bp =buddypress); 
  3. $steps = array_keys( $bp->groups->group_creation_steps ); 
  4.  
  5. // Loop through steps. 
  6. foreach ( $steps as $slug ) { 
  7.  
  8. // Break when the current step is found. 
  9. if ( bp_is_action_variable( $slug ) ) { 
  10. break; 
  11.  
  12. // Add slug to previous steps. 
  13. $previous_steps[] = $slug; 
  14.  
  15. // Generate the URL for the previous step. 
  16. $group_directory = bp_get_groups_directory_permalink(); 
  17. $create_step = 'create/step/'; 
  18. $previous_step = array_pop( $previous_steps ); 
  19. $url = trailingslashit( $group_directory . $create_step . $previous_step ); 
  20.  
  21. /** 
  22. * Filters the permalink for the previous step with the group creation process. 
  23. * @since 1.1.0 
  24. * @param string $url Permalink for the previous step. 
  25. */