bb_latest_topics_pages

The BuddyPress bb latest topics pages function.

Description

bb_latest_topics_pages( (null) $args = null ); 

Parameters (1)

0. $args — Optional. (null) => null
The args.

Usage

  1. if ( !function_exists( 'bb_latest_topics_pages' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The args. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_latest_topics_pages($args); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_latest_topics_pages( $args = null ) 
  2. $defaults = array( 'before' => '', 'after' => '' ); 
  3. $args = wp_parse_args( $args, $defaults ); 
  4.  
  5. global $page; 
  6. static $bb_latest_topics_count; 
  7. if ( !$bb_latest_topics_count) { 
  8. global $bbdb; 
  9. $bb_latest_topics_count = $bbdb->get_var('SELECT COUNT(`topic_id`) FROM `' . $bbdb->topics . '` WHERE `topic_status` = 0 AND `topic_sticky` != 2;'); 
  10. if ( $pages = apply_filters( 'bb_latest_topics_pages', get_page_number_links( $page, $bb_latest_topics_count ), $bb_latest_topics_count ) ) { 
  11. echo $args['before'] . $pages . $args['after'];