diff --git src/includes/replies/template.php src/includes/replies/template.php
index 5b5f2bc..fe7936e 100644
|
|
function bbp_get_reply_topic_id( $reply_id = 0 ) { |
1476 | 1476 | $reply_id = bbp_get_reply_id( $reply_id ); |
1477 | 1477 | if ( ! empty( $reply_id ) ) { |
1478 | 1478 | $topic_id = get_post_meta( $reply_id, '_bbp_topic_id', true ); |
| 1479 | |
| 1480 | // Make every effort to get topic id |
| 1481 | if ( empty( $topic_id ) && 'bbp_deleted_reply' === current_action() ) { |
| 1482 | $topic_id = get_post_field( 'post_parent', $reply_id ); |
| 1483 | } |
| 1484 | |
1479 | 1485 | if ( ! empty( $topic_id ) ) { |
1480 | 1486 | $topic_id = bbp_get_topic_id( $topic_id ); |
1481 | 1487 | } |
… |
… |
function bbp_get_reply_forum_id( $reply_id = 0 ) { |
1516 | 1522 | $reply_id = bbp_get_reply_id( $reply_id ); |
1517 | 1523 | if ( ! empty( $reply_id ) ) { |
1518 | 1524 | $forum_id = get_post_meta( $reply_id, '_bbp_forum_id', true ); |
| 1525 | |
| 1526 | // Make every effort to get forum id |
| 1527 | if ( empty( $forum_id ) && 'bbp_deleted_reply' === current_action() ) { |
| 1528 | $forum_id = bbp_get_topic_forum_id( get_post_field( 'post_parent', $reply_id ) ); |
| 1529 | } |
| 1530 | |
1519 | 1531 | if ( ! empty( $forum_id ) ) { |
1520 | 1532 | $forum_id = bbp_get_forum_id( $forum_id ); |
1521 | 1533 | } |