bb_get_latest_posts

The BuddyPress bb get latest posts function.

Description

bb_get_latest_posts( (int) $limit = 0, (int) $page = 1 ); 

Parameters (2)

0. $limit — Optional. (int)
The limit.
1. $page — Optional. (int) => 1
The page.

Usage

  1. if ( !function_exists( 'bb_get_latest_posts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php'; 
  3.  
  4. // The limit. 
  5. $limit = -1; 
  6.  
  7. // The page. 
  8. $page = 1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_get_latest_posts($limit, $page); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-posts.php  
  1. function bb_get_latest_posts( $limit = 0, $page = 1 ) { 
  2. $limit = (int) $limit; 
  3. $post_query = new BB_Query( 'post', array( 'page' => $page, 'per_page' => $limit ), 'get_latest_posts' ); 
  4. return $post_query->results;