bbp_get_stickies

Return sticky topics of a forum.

Description

(array) bbp_get_stickies( (int) $forum_id = 0 ); 

Returns (array)

IDs of sticky topics of a forum or super stickies

Parameters (1)

0. $forum_id — Optional. (int)
If not passed, super stickies are returned.

Usage

  1. if ( !function_exists( 'bbp_get_stickies' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/topics/functions.php'; 
  3.  
  4. // Optional. If not passed, super stickies are returned. 
  5. $forum_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_stickies($forum_id); 
  9.  

Defined (1)

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

/includes/topics/functions.php  
  1. function bbp_get_stickies( $forum_id = 0 ) { 
  2. $stickies = empty( $forum_id ) ? bbp_get_super_stickies() : get_post_meta( $forum_id, '_bbp_sticky_topics', true ); 
  3. $stickies = ( empty( $stickies ) || !is_array( $stickies ) ) ? array() : $stickies; 
  4.  
  5. return apply_filters( 'bbp_get_stickies', $stickies, (int) $forum_id );