bbp_is_forum( int $post_id )

Check if current page is a bbPress forum


Description Description


Parameters Parameters

$post_id

(Required) Possible post_id to check


Top ↑

Return Return

(bool) True if it's a forum page, false if not


Top ↑

Source Source

File: includes/common/template.php

function bbp_is_forum( $post_id = 0 ) {

	// Assume false
	$retval = false;

	// Supplied ID is a forum
	if ( ! empty( $post_id ) && ( bbp_get_forum_post_type() === get_post_type( $post_id ) ) ) {
		$retval = true;
	}

	// Filter & return
	return (bool) apply_filters( 'bbp_is_forum', $retval, $post_id );
}

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.