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

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


Parameters Parameters

$user_id

(int) (Required) ID of the user.

$group_id

(int) (Required) ID of the group.


Top ↑

Return Return

(mixed)


Source Source

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

	public static function check_is_mod( $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_mod = 1 AND is_banned = 0", $user_id, $group_id ) );
	}


Top ↑

Changelog 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.