bp_groups_get_excluded_group_ids_by_type()

Get groups removed from group type.

Description

Return

(array)

Source

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

function bp_groups_get_excluded_group_ids_by_type() {

	$group_id = array();

	// get removed group type post ids
	$bp_group_type_ids = bp_groups_get_excluded_group_types();

	// get removed group type names/slugs
	$bp_group_type_names = array();
	if ( isset( $bp_group_type_ids ) && ! empty( $bp_group_type_ids ) ) {
		foreach ( $bp_group_type_ids as $single ) {
			$bp_group_type_names[] = $single['name'];
		}
	}

	// get group group ids
	if ( isset( $bp_group_type_names ) && ! empty( $bp_group_type_names ) ) {
		foreach ( $bp_group_type_names as $type_name ) {
			$group_ids = bp_get_group_ids_by_group_types( $type_name );

			if ( isset( $group_ids ) && ! empty( $group_ids ) ) {
				foreach ( $group_ids as $single ) {
					$group_id[] = $single['id'];
				}
			}
		}
	}

	return bp_group_ids_array_flatten( $group_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.