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

442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
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

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.