bb_stick_topic

The BuddyPress bb stick topic function.

Description

bb_stick_topic( $topic_id, (int) $super = 0 ); 

Parameters (2)

0. $topic_id
The topic id.
1. $super — Optional. (int)
The super.

Usage

  1. if ( !function_exists( 'bb_stick_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. // The super. 
  8. $super = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_stick_topic($topic_id, $super); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-topics.php  
  1. function bb_stick_topic( $topic_id, $super = 0 ) { 
  2. global $bbdb; 
  3. $topic_id = (int) $topic_id; 
  4. $stick = 1 + abs((int) $super); 
  5. wp_cache_delete( $topic_id, 'bb_topic' ); 
  6. $r = $bbdb->update( $bbdb->topics, array( 'topic_sticky' => $stick ), compact( 'topic_id' ) ); 
  7. do_action('stick_topic', $topic_id, $r); 
  8. return $r;