BP_Group_Extension::user_can_visit( bool $user_can_visit = false )

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


Description 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 Parameters

$user_can_visit

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

Default value: false


Top ↑

Return Return

(bool)


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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