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.

Description

Parameters

$group

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

Default value: null

$user_id

(Optional) ID of the user.

Return

(bool)

Source

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

1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
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 );
}

Changelog

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