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-functions.php

    r13146 r13149  
    35963596    wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
    35973597
     3598    if ( 'activity_comment' === $activity->type ) {
     3599        $activity_id = $activity->item_id;
     3600    } else {
     3601        $activity_id = $activity->id;
     3602    }
     3603
    35983604    // Clear the activity comment cache for this activity item.
    3599     wp_cache_delete( $activity->id, 'bp_activity_comments' );
     3605    wp_cache_delete( $activity_id, 'bp_activity_comments' );
    36003606
    36013607    // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
     
    36433649    wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
    36443650
     3651    if ( 'activity_comment' === $activity->type ) {
     3652        $activity_id = $activity->item_id;
     3653    } else {
     3654        $activity_id = $activity->id;
     3655    }
     3656
    36453657    // Clear the activity comment cache for this activity item.
    3646     wp_cache_delete( $activity->id, 'bp_activity_comments' );
     3658    wp_cache_delete( $activity_id, 'bp_activity_comments' );
    36473659
    36483660    // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
Note: See TracChangeset for help on using the changeset viewer.