bb_export_topic_posts

The BuddyPress bb export topic posts function.

Description

bb_export_topic_posts( $r, $topic_id ); 

Parameters (2)

0. $r
The r.
1. $topic_id
The topic id.

Usage

  1. if ( !function_exists( 'bb_export_topic_posts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/export.php'; 
  3.  
  4. // The r. 
  5. $r = null; 
  6.  
  7. // The topic id. 
  8. $topic_id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_export_topic_posts($r, $topic_id); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/export.php  
  1. function bb_export_topic_posts( $r, $topic_id ) { 
  2. if ( !get_topic( $topic_id ) ) 
  3. return; 
  4.  
  5. $r .= "\n"; 
  6.  
  7. $page = 1; 
  8. while ( $posts = get_thread( $topic_id, array( 'post_status' => 'all', 'page' => $page++ ) ) ) { 
  9. foreach ( $posts as $post ) 
  10. $r .= bb_export_post( $post->post_id ); 
  11.  
  12. return $r;