bbp_is_custom_post_type( mixed $the_post = false )
Check if the current post type is one of Forums’
Description
Parameters
- $the_post
-
(Optional) Post object or post ID.
Default value: false
Return
(bool)
Source
File: bp-forums/common/template.php
function bbp_is_custom_post_type( $the_post = false ) { // Assume false $retval = false; // Viewing one of the Forums post types if ( in_array( get_post_type( $the_post ), array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() ) ) ) $retval = true; return (bool) apply_filters( 'bbp_is_custom_post_type', $retval, $the_post ); }
Changelog
Version | Description |
---|---|
bbPress (r3311) | 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.