bb_new_post

The BuddyPress bb new post function.

Description

bb_new_post( $topic_id, $post_text ); 

Parameters (2)

0. $topic_id
The topic id.
1. $post_text
The post text.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-posts.php  
  1. function bb_new_post( $topic_id, $post_text ) { 
  2. $post_text = stripslashes( $post_text ); 
  3. return bb_insert_post( compact( 'topic_id', 'post_text' ) );