bp_get_group_member_count

Generate the "x members" count string for a group.

Description

(string) bp_get_group_member_count(); 

Returns (string)


Usage

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

Defined (1)

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

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_member_count() { 
  2. global $groups_template; 
  3.  
  4. if ( isset( $groups_template->group->total_member_count ) ) { 
  5. $count = (int) $groups_template->group->total_member_count; 
  6. } else { 
  7. $count = 0; 
  8.  
  9. $count_string = sprintf( _n( '%s member', '%s members', $count, buddypress ), bp_core_number_format( $count ) ); 
  10.  
  11. /** 
  12. * Filters the "x members" count string for a group. 
  13. * @since 1.2.0 
  14. * @param string $count_string The "x members" count string for a group. 
  15. */ 
  16. return apply_filters( 'bp_get_group_member_count', $count_string );