bp_member_type_type_id( type $type_name )

Gets profile type id.

Description

Parameters

$type_name

(type) (Required)

Return

(type) int

Source

File: bp-core/deprecated/buddyboss/1.1.8.php

function bp_member_type_type_id( $type_name ) {
	global $wpdb;
	$type_name = strtolower($type_name);
	$type_name = str_replace(array(' ', ','), array('-', '-'), $type_name);

	$type_id = $wpdb->get_col( "SELECT t.term_id FROM {$wpdb->prefix}terms t INNER JOIN {$wpdb->prefix}term_taxonomy tt ON t.term_id = tt.term_id WHERE t.slug = '" . $type_name . "' AND  tt.taxonomy = 'bp_member_type' " );
	return ! isset( $type_id[ 0 ] ) ? '' : $type_id[ 0 ];
}

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.