bp_group_get_group_type_id( string $group_type = '' )

Gets the post id of particular group type.

Description

Parameters

$group_type

(string) (Optional)

Default value: ''

Return

(mixed)

Source

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

function bp_group_get_group_type_id( $group_type = '' ) {

	$args             = array(
		'post_type'  => 'bp-group-type',
		'meta_query' => array(
			array(
				'key'   => '_bp_group_type_key',
				'value' => $group_type,
			),
		),
	);
	$group_type_query = new WP_Query( $args );

	$posts = $group_type_query->posts;

	$id = ( is_array( $posts ) && isset( $posts[0]->ID ) ) ? $posts[0]->ID : 0;

	return $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.