BP_Groups_Member::check_is_member( int $user_id, int $group_id )

Check whether a user is a member of a given group.

Parameters Parameters


(int) (Required) ID of the user.


(int) (Required) ID of the group.

Top ↑

Return Return


Source Source

File: bp-groups/classes/class-bp-groups-member.php

	public static function check_is_member( $user_id, $group_id ) {
		global $wpdb;

		if ( empty( $user_id ) )
			return false;

		$bp = buddypress();

		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id, $group_id ) );

Top ↑

Changelog Changelog

Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.