BP_Groups_Group::is_visible()

Checks whether the current user can know the group exists.


Description Description


Return Return

(bool)


Top ↑

Source Source

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

	protected function is_visible() {
		if ( isset( $this->is_visible ) ) {
			return $this->is_visible;
		}

		if ( 'hidden' === $this->status ) {

			// Assume user can not know about hidden groups.
			$this->is_visible = false;

			// Group members or community moderators have access.
			if ( ( is_user_logged_in() && $this->get_is_member() ) || bp_current_user_can( 'bp_moderate' ) ) {
				$this->is_visible = true;
			}
		} else {
			$this->is_visible = true;
		}

		return $this->is_visible;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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