bp_forums_sticky_topic

Set a topic as sticky/unsticky.

Description

bp_forums_sticky_topic( (string) $args = '' ); 

Parameters (1)

0. $args — Optional. (string) => ''
Array of arguments for sticky topic.

Usage

  1. if ( !function_exists( 'bp_forums_sticky_topic' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-functions.php'; 
  3.  
  4. // Array of arguments for sticky topic. 
  5. $args = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_sticky_topic($args); 
  9.  

Defined (1)

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

/bp-forums/bp-forums-functions.php  
  1. function bp_forums_sticky_topic( $args = '' ) { 
  2.  
  3. /** This action is documented in bp-forums/bp-forums-screens.php */ 
  4.  
  5. $r = wp_parse_args( $args, array( 
  6. 'topic_id' => false,  
  7. 'mode' => 'stick' // Stick/unstick. 
  8. ) ); 
  9. extract( $r, EXTR_SKIP ); 
  10.  
  11. if ( 'stick' == $mode ) 
  12. return bb_stick_topic( $topic_id ); 
  13. else if ( 'unstick' == $mode ) 
  14. return bb_unstick_topic( $topic_id ); 
  15.  
  16. return false;