Skip to:
Content

bbPress.org

Changeset 5859


Ignore:
Timestamp:
07/16/2015 04:59:05 AM (6 years ago)
Author:
johnjamesjacoby
Message:

Replies: fallback on post_parent in bbp_update_reply_walker().

This changeset fixes a bug where topic reply counts were not updated when replies were permanently deleted, causing hidden reply counts to be wildly inaccurate.

Props thebrandonallen. Fixes #2529.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r5829 r5859  
    927927        if ( empty( $topic_id ) ) {
    928928            $topic_id = bbp_get_reply_topic_id( $reply_id );
     929
     930            // Make every effort to get topic id
     931            // https://bbpress.trac.wordpress.org/ticket/2529
     932            if ( empty( $topic_id ) && ( current_action() === 'bbp_deleted_reply' ) ) {
     933                $topic_id = get_post_field( 'post_parent', $reply_id );
     934            }
    929935        }
    930936
Note: See TracChangeset for help on using the changeset viewer.