bp_get_notifications_pagination_count

Return the pagination count for the current notification loop.

Description

(string) bp_get_notifications_pagination_count(); 

Returns (string)

HTML for the pagination count.


Usage

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

Defined (1)

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

/bp-notifications/bp-notifications-template.php  
  1. function bp_get_notifications_pagination_count() { 
  2. $query_loop =buddypress)->notifications->query_loop; 
  3. $start_num = intval( ( $query_loop->pag_page - 1 ) * $query_loop->pag_num ) + 1; 
  4. $from_num = bp_core_number_format( $start_num ); 
  5. $to_num = bp_core_number_format( ( $start_num + ( $query_loop->pag_num - 1 ) > $query_loop->total_notification_count ) ? $query_loop->total_notification_count : $start_num + ( $query_loop->pag_num - 1 ) ); 
  6. $total = bp_core_number_format( $query_loop->total_notification_count ); 
  7.  
  8. if ( 1 == $query_loop->total_notification_count ) { 
  9. $pag = __( 'Viewing 1 notification', buddypress ); 
  10. } else { 
  11. $pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s notification', 'Viewing %1$s - %2$s of %3$s notifications', $query_loop->total_notification_count, buddypress ), $from_num, $to_num, $total ); 
  12.  
  13. /** 
  14. * Filters the pagination count for the current notification loop. 
  15. * @since 1.9.0 
  16. * @param string $pag HTML for the pagination count. 
  17. */