bp_get_the_topic_is_sticky
Filters whether or not the current topic in the loop is sticky.
Description
Parameters (1)
- 0. $forum_template_topic_topic_sticky (bool)
- Whether or not the current topic is sticky.
Usage
- To run the hook, copy the example below.
- $forum_template_topic_topic_sticky = apply_filters( 'bp_get_the_topic_is_sticky', $forum_template_topic_topic_sticky );
- if ( !empty( $forum_template_topic_topic_sticky ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_get_the_topic_is_sticky callback
- function filter_bp_get_the_topic_is_sticky( $forum_template_topic_topic_sticky ) {
- // make filter magic happen here...
- return $forum_template_topic_topic_sticky;
- };
- // add the filter
- add_filter( 'bp_get_the_topic_is_sticky', 'filter_bp_get_the_topic_is_sticky', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'bp_get_the_topic_is_sticky', 'filter_bp_get_the_topic_is_sticky', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /bp-forums/bp-forums-template.php
- return apply_filters( 'bp_get_the_topic_is_sticky', $forum_template->topic->topic_sticky );