BP_Groups_Group::__get( string $key )

Magic getter.

Description

Parameters

$key

(string) (Required) Property name.

Return

(mixed)

Source

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

	public function __get( $key ) {
		switch ( $key ) {
			case 'last_activity' :
			case 'total_member_count' :
			case 'forum_id' :
				$retval = groups_get_groupmeta( $this->id, $key );

				if ( 'last_activity' !== $key ) {
					$retval = (int) $retval;
				}

				return $retval;

			case 'admins' :
				return $this->get_admins();

			case 'mods' :
				return $this->get_mods();

			case 'is_member' :
			case 'is_user_member' :
				return $this->get_is_member();

			case 'is_invited' :
				return groups_check_user_has_invite( bp_loggedin_user_id(), $this->id );

			case 'is_pending' :
				return groups_check_for_membership_request( bp_loggedin_user_id(), $this->id );

			case 'user_has_access' :
				return $this->get_user_has_access();

			case 'is_visible' :
				return $this->is_visible();

			default :
				return isset( $this->{$key} ) ? $this->{$key} : null;
		}
	}

Changelog

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