bp_is_group_creator( BP_Groups_Group|null $group = null, int $user_id )

Determine whether a user is the creator of the current group in the loop.


Parameters Parameters

$group

(BP_Groups_Group|null) (Optional) Group object. Default: current group in loop.

Default value: null

$user_id

(int) (Optional) ID of the user.


Top ↑

Return Return

(bool)


Source Source

File: bp-groups/bp-groups-template.php

function bp_is_group_creator( $group = null, $user_id = 0 ) {
	global $groups_template;

	if ( empty( $group ) ) {
		$group =& $groups_template->group;
	}

	if ( empty( $user_id ) ) {
		$user_id = bp_loggedin_user_id();
	}

	return (bool) ( $group->creator_id == $user_id );
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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