bp_get_user_member_type( $user_id )

Get profile type.

Description

Parameters

$user_id

(Required)

Return

(string)

Source

File: bp-members/bp-members-functions.php

function bp_get_user_member_type( $user_id ) {

	if ( empty( $user_id ) ) {
		$user_id = bp_displayed_user_id();
	}

	$member_type = '';

	if ( bp_is_members_directory() ) {

		$member_type = __('Member', 'buddyboss');

		if ( true === bp_member_type_enable_disable() ) {
			if ( true === bp_member_type_display_on_profile() ) {

				// Get the profile type.
				$type = bp_get_member_type( $user_id );

				// Output the
				if ( $type_obj = bp_get_member_type_object( $type ) ) {
					$member_type = $type_obj->labels['singular_name'];
				}

				$string = '<span class="bp-member-type">'.$member_type.'</span>';
			} else {
				$string = '<span class="bp-member-type">'.$member_type.'</span>';
			}
		} else {
			$string = '<span class="bp-member-type">'.$member_type.'</span>';
		}
	} else {

		if ( true === bp_member_type_enable_disable() ) {
			if ( true === bp_member_type_display_on_profile() ) {

				// Get the profile type.
				$type = bp_get_member_type( $user_id );

				// Output the
				if ( $type_obj = bp_get_member_type_object( $type ) ) {
					$member_type = $type_obj->labels['singular_name'];
					$string = '<span class="bp-member-type">'.$member_type.'</span>';
				} else {
					$string = '';
				}
			} else {
				$string = '';
			}
		} else {
			$string = '';
		}
	}

	return apply_filters('bp_member_type_name_string', $string, $member_type, $user_id );
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.