bb_new_topic

The BuddyPress bb new topic function.

Description

bb_new_topic( $title, $forum, (string) $tags = '', (string) $args = '' ); 

Parameters (4)

0. $title
The title.
1. $forum
The forum.
2. $tags — Optional. (string) => ''
The tags.
3. $args — Optional. (string) => ''
The args.

Usage

  1. if ( !function_exists( 'bb_new_topic' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-topics.php'; 
  3.  
  4. // The title. 
  5. $title = null; 
  6.  
  7. // The forum. 
  8. $forum = null; 
  9.  
  10. // The tags. 
  11. $tags = ''; 
  12.  
  13. // The args. 
  14. $args = ''; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bb_new_topic($title, $forum, $tags, $args); 
  18.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-topics.php  
  1. function bb_new_topic( $title, $forum, $tags = '', $args = '' ) { 
  2. $title = stripslashes( $title ); 
  3. $tags = stripslashes( $tags ); 
  4. $forum = (int) $forum; 
  5. return bb_insert_topic( wp_parse_args( $args ) + array( 'topic_title' => $title, 'forum_id' => $forum, 'tags' => $tags ) );