bbp_get_reply_forum_id( int $reply_id )

Return the forum id a reply belongs to

Description

Parameters

$reply_id

(Optional) Reply id

Return

(int) Reply's forum id

Source

File: bp-forums/replies/template.php

	function bbp_get_reply_forum_id( $reply_id = 0 ) {

		// Assume there is no forum
		$forum_id = 0;

		// Check that reply_id is valid
		if ( $reply_id = bbp_get_reply_id( $reply_id ) )

			// Get forum_id from reply
			if ( $forum_id = get_post_meta( $reply_id, '_bbp_forum_id', true ) )

				// Validate the forum_id
				$forum_id = bbp_get_forum_id( $forum_id );

		return (int) apply_filters( 'bbp_get_reply_forum_id', $forum_id, $reply_id );
	}

Changelog

Changelog
Version Description
bbPress (r2679) 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.