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

Is the specified user the creator of the group?

Description

Parameters

$user_id

(Required) ID of the user.

$group_id

(Required) ID of the group.

Return

(int|null) int of group ID if user is the creator; null on failure.

Source

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

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

		if ( empty( $user_id ) )
			return false;

		$bp = buddypress();

		$query = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name} WHERE creator_id = %d AND id = %d", $user_id, $group_id ) );

		return is_numeric( $query ) ? (int) $query : $query;
	}

Changelog

Changelog
Version Description
BuddyPress 1.2.6 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.