bb_export_post

The BuddyPress bb export post function.

Description

bb_export_post( $post_id ); 

Parameters (1)

0. $post_id
The post id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-admin/export.php  
  1. function bb_export_post( $post_id ) { 
  2. if ( !$_post = bb_get_post( $post_id ) ) 
  3. return; 
  4.  
  5. $_post = get_object_vars($_post); 
  6.  
  7. $atts = array( 
  8. 'type' => 'post',  
  9. 'id' => $_post['post_id'],  
  10. 'author' => 'user_' . $_post['poster_id'] 
  11. ); 
  12.  
  13. $translate = array( 
  14. 'post_time' => 'incept',  
  15. 'post_text' => '!content',  
  16. 'post_status' => '?status',  
  17. 'post_id' => false,  
  18. 'poster_id' => false,  
  19. 'forum_id' => false,  
  20. 'topic_id' => false,  
  21. 'post_position' => false 
  22. ); 
  23.  
  24. $post = _bb_translate_for_export( $translate, $_post ); 
  25.  
  26. $post['meta'] = $_post; 
  27.  
  28. return _bb_export_object( $atts, $post, 2 );