bb_get_topic_pagecount

Bb_get_topic_pagecount() - Get the total page count for a topic.

Description

(int) bb_get_topic_pagecount( (int) $topic_id = 0 ); 

Returns (int)

The total number of pages in the topic

Parameters (1)

0. $topic_id — Optional. (int)
The topic id of the topic being queried

Usage

  1. if ( !function_exists( 'bb_get_topic_pagecount' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The topic id of the topic being queried 
  5. $topic_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_topic_pagecount($topic_id); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_get_topic_pagecount( $topic_id = 0 ) { 
  2. $topic = get_topic( get_topic_id( $topic_id ) ); 
  3. return bb_get_page_number( $topic->topic_posts + topic_pages_add() );