diff --git src/bp-activity/bp-activity-cache.php src/bp-activity/bp-activity-cache.php
index da7542770..d1105d559 100644
|
|
function bp_activity_update_meta_cache( $activity_ids = false ) { |
47 | 47 | function bp_activity_clear_cache_for_activity( $activity ) { |
48 | 48 | wp_cache_delete( $activity->id, 'bp_activity' ); |
49 | 49 | wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); |
| 50 | |
| 51 | // Also 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 | } |
50 | 55 | } |
51 | 56 | add_action( 'bp_activity_after_save', 'bp_activity_clear_cache_for_activity' ); |
52 | 57 | |
diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
index cf9410657..5c63e342f 100644
|
|
function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { |
3547 | 3547 | // Clear the activity stream first page cache. |
3548 | 3548 | wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); |
3549 | 3549 | |
| 3550 | if ( 'activity_comment' === $activity->type ) { |
| 3551 | $activity_id = $activity->item_id; |
| 3552 | } else { |
| 3553 | $activity_id = $activity->id; |
| 3554 | |
| 3555 | // Clear the activity cache for this activity item. |
| 3556 | wp_cache_delete( $activity->id, 'bp_activity' ); |
| 3557 | } |
| 3558 | |
3550 | 3559 | // Clear the activity comment cache for this activity item. |
3551 | | wp_cache_delete( $activity->id, 'bp_activity_comments' ); |
| 3560 | wp_cache_delete( $activity_id, 'bp_activity_comments' ); |
3552 | 3561 | |
3553 | 3562 | // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity. |
3554 | 3563 | if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) { |
… |
… |
function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { |
3594 | 3603 | // Clear the activity stream first page cache. |
3595 | 3604 | wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); |
3596 | 3605 | |
3597 | | // Clear the activity comment cache for this activity item. |
3598 | | wp_cache_delete( $activity->id, 'bp_activity_comments' ); |
| 3606 | if ( 'activity_comment' === $activity->type ) { |
| 3607 | $activity_id = $activity->item_id; |
| 3608 | } else { |
| 3609 | $activity_id = $activity->id; |
| 3610 | |
| 3611 | // Clear the activity cache for this activity item. |
| 3612 | wp_cache_delete( $activity->id, 'bp_activity' ); |
| 3613 | } |
| 3614 | |
| 3615 | // Purge comment cache for the root activity update. |
| 3616 | wp_cache_delete( $activity_id, 'bp_activity_comments' ); |
3599 | 3617 | |
3600 | 3618 | // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity. |
3601 | 3619 | if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) { |