bb_post_author_cache

The BuddyPress bb post author cache function.

Description

bb_post_author_cache( $posts ); 

Parameters (1)

0. $posts
The posts.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-posts.php  
  1. function bb_post_author_cache($posts) { 
  2. if ( !$posts ) 
  3. return; 
  4.  
  5. $ids = array(); 
  6. foreach ($posts as $bb_post) 
  7. $ids[] = $bb_post->poster_id; 
  8.  
  9. if ( $ids ) 
  10. bb_cache_users(array_unique($ids));