BP_Group_Extension::user_can_visit( bool $user_can_visit = false )

Determine whether the current user has access to visit this tab.

Description

Note that this controls the ability of a user to access a tab. Display of the navigation item is controlled by user_can_see_nav_item().

Parameters

$user_can_visit

(Optional) Whether or not the user can visit the tab.

Default value: false

Return

(bool)

Source

File: bp-groups/classes/class-bp-group-extension.php

	public function user_can_visit( $user_can_visit = false ) {

		// Always allow moderators to visit a tab, even if explicitly 'noone'
		if ( ( 'noone' !== $this->params['access'] ) && bp_current_user_can( 'bp_moderate' ) ) {
			return true;
		}

		return $this->user_can_visit;
	}

Changelog

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