bp_active_member_type_by_type( $type_id )

Gets an active member by type.

Description

Parameters

$type_id

(Required)

Return

(array)

Source

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

function bp_active_member_type_by_type( $type_id ) {
	global $wpdb;

	$member_ids = array();

	if ( empty ( $type_id ) ) {
		return $member_ids;
	}

	$get_user_ids = $wpdb->get_col( "SELECT u.ID FROM {$wpdb->users} u INNER JOIN {$wpdb->prefix}term_relationships r ON u.ID = r.object_id WHERE u.user_status = 0 AND r.term_taxonomy_id = " . $type_id );

	if ( isset( $get_user_ids ) && !empty( $get_user_ids ) ) {
		foreach ( $get_user_ids as $single ) {
			$member_activity = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}bp_activity a WHERE a.user_id = " . $single );
			if ( $member_activity > 0 ) {
				$member_ids[] = $single;
			}
		}
	}

	return $member_ids;
}

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.