diff --git includes/replies/functions.php includes/replies/functions.php
index dbb8e80..90f8510 100644
|
|
function bbp_toggle_reply_handler( $action = '' ) { |
1574 | 1574 | case 'delete': |
1575 | 1575 | check_ajax_referer( 'delete-' . bbp_get_reply_post_type() . '_' . $reply_id ); |
1576 | 1576 | |
| 1577 | // Set forum/topic ids, as deleting the reply prevents retrieval |
| 1578 | $forum_id = bbp_get_reply_forum_id( $reply_id ); |
| 1579 | $topic_id = bbp_get_reply_topic_id( $reply_id ); |
| 1580 | |
1577 | 1581 | $success = wp_delete_post( $reply_id ); |
1578 | 1582 | $failure = __( '<strong>ERROR</strong>: There was a problem deleting the reply!', 'bbpress' ); |
1579 | 1583 | |
| 1584 | // On success, update forum/topic meta |
| 1585 | if ( ( false !== $success ) && !is_wp_error( $success ) ) { |
| 1586 | bbp_update_reply_walker( $reply_id, '', $forum_id, $topic_id, false ); |
| 1587 | } |
| 1588 | |
1580 | 1589 | break; |
1581 | 1590 | } |
1582 | 1591 | |