BP_Groups_Group::__get( string $key )

Magic getter.

Description

Parameters

$key

(Required) Property name.

Return

(mixed)

Source

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

429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
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.