Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/05/2014 02:15:53 PM (10 years ago)
Author:
boonebgorges
Message:

Add persistent caching support for xprofile field data

See #1332

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-cache.php

    r7434 r7786  
    5656add_action( 'bp_first_activity_for_member',   'bp_core_clear_member_count_caches' );
    5757add_action( 'deleted_user',                   'bp_core_clear_member_count_caches' );
     58
     59/**
     60 * Determine which items from a list do not have cached values.
     61 *
     62 * @since BuddyPress (2.0.0)
     63 *
     64 * @param array $item_ids ID list.
     65 * @param string $cache_group The cache group to check against.
     66 * @return array
     67 */
     68function bp_get_non_cached_ids( $item_ids, $cache_group ) {
     69    $uncached = array();
     70
     71    foreach ( $item_ids as $item_id ) {
     72        $item_id = (int) $item_id;
     73        if ( false === wp_cache_get( $item_id, $cache_group ) ) {
     74            $uncached[] = $item_id;
     75        }
     76    }
     77
     78    return $uncached;
     79}
    5880
    5981/**
Note: See TracChangeset for help on using the changeset viewer.