Skip to:
Content

BuddyPress.org

Changeset 8996


Ignore:
Timestamp:
09/09/2014 10:27:44 PM (5 years ago)
Author:
r-a-y
Message:

Activity: Clear comment cache when adding an activity comment with bp_activity_add().

This commit fixes issues with the activity comment cache not being cleared
when a new activity comment is created using bp_activity_add().

This notably occurs when posting a blog comment and when the activity stream
commenting for blog posts feature is enabled. See bp_blogs_record_comment().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r8990 r8996  
    12271227    // If this is an activity comment, rebuild the tree
    12281228    if ( 'activity_comment' === $activity->type ) {
     1229        // Also clear the comment cache for the parent activity ID
     1230        wp_cache_delete( $activity->item_id, 'bp_activity_comments' );
     1231
    12291232        BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id );
    12301233    }
Note: See TracChangeset for help on using the changeset viewer.