BP_Core_User::populate_extras()
Populates extra fields such as group and friendship counts.
Contents
Description Description
Source Source
File: bp-core/classes/class-bp-core-user.php
public function populate_extras() { if ( bp_is_active( 'friends' ) ) { $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id ); } if ( bp_is_active( 'groups' ) ) { $this->total_groups = BP_Groups_Member::total_group_count( $this->id ); $this->total_groups = sprintf( _n( '%d group', '%d groups', $this->total_groups, 'buddypress' ), $this->total_groups ); } }