bbp_is_topic_sticky( int $topic_id, int $check_super = true )
Is the topic a sticky or super sticky?
Description Description
Parameters Parameters
- $topic_id
-
(Optional) Topic id
- $check_super
-
(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 Return
(bool) True if sticky or super sticky, false if not.
Source Source
File: includes/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 ); $retval = in_array( $topic_id, $stickies, true ); // Maybe check super stickies if ( ( false === $retval ) && ( true === $check_super ) ) { $retval = bbp_is_topic_super_sticky( $topic_id ); } // Filter & return return (bool) apply_filters( 'bbp_is_topic_sticky', $retval, $topic_id, $check_super ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |