bp_get_activity_pagination_count

Return the activity pagination count.

Description

(string) bp_get_activity_pagination_count(); 

Returns (string)

The pagination text.


Usage

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

Defined (1)

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

/bp-activity/bp-activity-template.php  
  1. function bp_get_activity_pagination_count() { 
  2. global $activities_template; 
  3.  
  4. $start_num = intval( ( $activities_template->pag_page - 1 ) * $activities_template->pag_num ) + 1; 
  5. $from_num = bp_core_number_format( $start_num ); 
  6. $to_num = bp_core_number_format( ( $start_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $start_num + ( $activities_template->pag_num - 1 ) ); 
  7. $total = bp_core_number_format( $activities_template->total_activity_count ); 
  8.  
  9. if ( 1 == $activities_template->total_activity_count ) { 
  10. $message = __( 'Viewing 1 item', buddypress ); 
  11. } else { 
  12. $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s item', 'Viewing %1$s - %2$s of %3$s items', $activities_template->total_activity_count, buddypress ), $from_num, $to_num, $total ); 
  13.  
  14. return $message;