Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/14/2021 03:16:38 PM (3 years ago)
Author:
imath
Message:

Improve the bp_activity_comments cache management

This cache should also be cleared when:

  • an activity comment has been marked as spam/ham.
  • an activity comment has been updated.

Props oztaser

Fixes #8296

File:
1 edited

Legend:

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

    r11101 r13149  
    4848    wp_cache_delete( $activity->id, 'bp_activity' );
    4949    wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
     50
     51    // Clear the comments cache for the parent activity ID.
     52    if ( 'activity_comment' === $activity->type ) {
     53        wp_cache_delete( $activity->item_id, 'bp_activity_comments' );
     54    }
    5055}
    5156add_action( 'bp_activity_after_save', 'bp_activity_clear_cache_for_activity' );
Note: See TracChangeset for help on using the changeset viewer.