bb_close_topic

The BuddyPress bb close topic function.

Description

bb_close_topic( $topic_id ); 

Parameters (1)

0. $topic_id
The topic id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-topics.php  
  1. function bb_close_topic( $topic_id ) { 
  2. global $bbdb; 
  3. $topic_id = (int) $topic_id; 
  4. wp_cache_delete( $topic_id, 'bb_topic' ); 
  5. $r = $bbdb->update( $bbdb->topics, array( 'topic_open' => 0 ), compact( 'topic_id' ) ); 
  6. do_action('close_topic', $topic_id, $r); 
  7. return $r;