Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/09/2013 02:26:50 PM (12 years ago)
Author:
boonebgorges
Message:

When deleting an activity item, clear its metadata cache

Because of the way that the cache groups are structured, there is no simple
way to figure out which cache keys should be dropped upon deletion. Our
solution is to scan through all the keys in the 'bp' group to determine the
relevant ones. It's not particularly elegant, but this kind of cache-busting
will happen rarely (namely, when an activity item is deleted) so the overhead
is negligible.

Fixes #4804

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r7048 r7051  
    480480        $activity_ids = implode( ',', wp_parse_id_list( $activity_ids ) );
    481481
     482        foreach ( (array) $activity_ids as $activity_id ) {
     483            bp_activity_clear_meta_cache_for_activity( $activity_id );
     484        }
     485
    482486        return $wpdb->query( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" );
    483487    }
Note: See TracChangeset for help on using the changeset viewer.