bp_get_member_type_directory_permalink

Return member type directory permalink.

Description

(string) bp_get_member_type_directory_permalink( (string) $member_type = '' ); 

Returns (string)

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

Parameters (1)

0. $member_type — Optional. (string) => ''
Member type. Defaults to current member type.

Usage

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

Defined (1)

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

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