bbp_get_reply_topic_id( int $reply_id )
Return the topic id a reply belongs to
Description Description
Parameters Parameters
- $reply_id
-
(Optional) Reply id
Return Return
(int) The topic id of the reply
Source Source
File: includes/replies/template.php
function bbp_get_reply_topic_id( $reply_id = 0 ) { $reply_id = bbp_get_reply_id( $reply_id ); $topic_id = (int) get_post_field( 'post_parent', $reply_id ); // Meta-data fallback if ( empty( $topic_id ) ) { $topic_id = (int) get_post_meta( $reply_id, '_bbp_topic_id', true ); } // Filter if ( ! empty( $topic_id ) ) { $topic_id = (int) bbp_get_topic_id( $topic_id ); } // Filter & return return (int) apply_filters( 'bbp_get_reply_topic_id', $topic_id, $reply_id ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |