bbp_get_reply_ancestor_id( in $reply_id )
Return the ancestor reply id of a reply
Description Description
Parameters Parameters
- $reply_id
-
(Required) Reply id
Source Source
File: includes/replies/template.php
function bbp_get_reply_ancestor_id( $reply_id = 0 ) { // Validation $reply_id = bbp_get_reply_id( $reply_id ); if ( empty( $reply_id ) ) { return false; } // Find highest reply ancestor $ancestor_id = $reply_id; while ( $parent_id = bbp_get_reply_to( $ancestor_id ) ) { if ( empty( $parent_id ) || ( $parent_id === $ancestor_id ) || ( bbp_get_reply_topic_id( $reply_id ) === $parent_id ) || ( $parent_id === $reply_id ) ) { break; } $ancestor_id = $parent_id; } return (int) $ancestor_id; }
Changelog Changelog
Version | Description |
---|---|
2.4.0 | Introduced. |