bbp_is_custom_post_type( mixed $the_post = false )

Check if the current post type is one that comes with bbPress


Description Description


Parameters Parameters

$the_post

(Optional) Post object or post ID.

Default value: false


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/common/template.php

function bbp_is_custom_post_type( $the_post = false ) {

	// Assume false
	$retval = false;

	// Viewing one of the bbPress 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()
	), true ) ) {
		$retval = true;
	}

	// Filter & return
	return (bool) apply_filters( 'bbp_is_custom_post_type', $retval, $the_post );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.