bp_get_group_type_directory_permalink

Return group type directory permalink.

Description

(string) bp_get_group_type_directory_permalink( (string) $group_type = '' ); 

Returns (string)

Group type directory URL on success, an empty string on failure.

Parameters (1)

0. $group_type — Optional. (string) => ''
Group type. Defaults to current group type.

Usage

  1. if ( !function_exists( 'bp_get_group_type_directory_permalink' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // Optional. Group type. Defaults to current group type. 
  5. $group_type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_group_type_directory_permalink($group_type); 
  9.  

Defined (1)

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

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_type_directory_permalink( $group_type = '' ) { 
  2.  
  3. if ( $group_type ) { 
  4. $_group_type = $group_type; 
  5. } else { 
  6. // Fall back on the current group type. 
  7.  
  8. $type = bp_groups_get_group_type_object( $_group_type ); 
  9.  
  10. // Bail when member type is not found or has no directory. 
  11. if ( ! $type || ! $type->has_directory ) { 
  12. return ''; 
  13.  
  14. /** 
  15. * Filters the group type directory permalink. 
  16. * @since 2.7.0 
  17. * @param string $value Group type directory permalink. 
  18. * @param object $type Group type object. 
  19. * @param string $member_type Group type name, as passed to the function. 
  20. */