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

1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
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.