bbp_is_topic_sticky( int $topic_id, int $check_super = true )
Is the topic a sticky or super sticky?
Description
Parameters
- $topic_id
-
(int) (Optional) Topic id
- $check_super
-
(int) (Optional) If set to true and if the topic is not a normal sticky, it is checked if it is a super sticky or not. Defaults to true.
Default value: true
Return
(bool) True if sticky or super sticky, false if not.
Source
File: bp-forums/topics/template.php
function bbp_is_topic_sticky( $topic_id = 0, $check_super = true ) { $topic_id = bbp_get_topic_id( $topic_id ); $forum_id = bbp_get_topic_forum_id( $topic_id ); $stickies = bbp_get_stickies( $forum_id ); if ( in_array( $topic_id, $stickies ) || ( !empty( $check_super ) && bbp_is_topic_super_sticky( $topic_id ) ) ) return true; return false; }
Changelog
Version | Description |
---|---|
bbPress (r2754) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.