BP_Groups_Group::__get( string $key )

Magic getter.


Parameters Parameters

$key

(string) (Required) Property name.


Top ↑

Return Return

(mixed)


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


Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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