bp_get_member_type_object

Retrieve a member type object by name.

Description

(object) bp_get_member_type_object( (string) $member_type ); 

Returns (object)

A member type object.

Parameters (1)

0. $member_type (string)
The name of the member type.

Usage

  1. if ( !function_exists( 'bp_get_member_type_object' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php'; 
  3.  
  4. // The name of the member type. 
  5. $member_type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_member_type_object($member_type); 
  9.  

Defined (1)

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

/bp-members/bp-members-functions.php  
  1. function bp_get_member_type_object( $member_type ) { 
  2. $types = bp_get_member_types( array(), 'objects' ); 
  3.  
  4. if ( empty( $types[ $member_type ] ) ) { 
  5. return null; 
  6.  
  7. return $types[ $member_type ];