bbp_is_topic( int $post_id )
Check if current page is a bbPress topic
Description Description
Parameters Parameters
- $post_id
-
(Required) Possible post_id to check
Return Return
(bool) True if it's a topic page, false if not
Source Source
File: includes/common/template.php
function bbp_is_topic( $post_id = 0 ) { // Assume false $retval = false; // Supplied ID is a topic if ( ! empty( $post_id ) && ( bbp_get_topic_post_type() === get_post_type( $post_id ) ) ) { $retval = true; } // Filter & return return (bool) apply_filters( 'bbp_is_topic', $retval, $post_id ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |