bbp_group_is_admin()

Is the current user an admin of the current group


Description Description


Return Return

(bool) If current user is an admin of the current group


Top ↑

Source Source

File: includes/extend/buddypress/functions.php

function bbp_group_is_admin() {

	// Bail if user is not logged in or not looking at a group
	if ( ! is_user_logged_in() || ! bp_is_group() ) {
		return false;
	}

	$bbp = bbpress();

	// Set the global if not set
	if ( ! isset( $bbp->current_user->is_group_admin ) ) {
		$bbp->current_user->is_group_admin = groups_is_user_admin( bp_loggedin_user_id(), bp_get_current_group_id() );
	}

	// Return the value
	return (bool) $bbp->current_user->is_group_admin;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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