bp_get_member_total_friend_count

Return the friend count for the current member in the loop.

Description

(string) bp_get_member_total_friend_count(); 

Return value is a string of the form x friends..

Returns (string)

A string of the form "x friends".


Usage

  1. if ( !function_exists( 'bp_get_member_total_friend_count' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-friends/bp-friends-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_member_total_friend_count(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-friends/bp-friends-template.php  
  1. function bp_get_member_total_friend_count() { 
  2. global $members_template; 
  3.  
  4. if ( 1 == (int) $members_template->member->total_friend_count ) { 
  5.  
  6. /** 
  7. * Filters text used to denote total friend count. 
  8. * @since 1.2.0 
  9. * @param string $value String of the form "x friends". 
  10. * @param int $value Total friend count for current member in the loop. 
  11. */ 
  12. return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', buddypress ), (int) $members_template->member->total_friend_count ) ); 
  13. } else { 
  14.  
  15. /** This filter is documented in bp-friends/bp-friends-template.php */ 
  16. return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', buddypress ), (int) $members_template->member->total_friend_count ) );