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

Is the specified user the creator of the group?

Parameters Parameters


(int) (Required) ID of the user.


(int) (Required) ID of the group.

Top ↑

Return Return

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

Source 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;

Top ↑

Changelog Changelog

Version Description
1.2.6 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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