bp_core_set_incremented_cache( string $key, string $group, array $ids )
Caches a value using an incremented key.
Description Description
An "incremented key" is a cache key that is hashed with a unique incrementor, allowing for bulk invalidation.
Use this method when caching data that should be invalidated whenever any object of a given type is created, updated, or deleted. This usually means data related to object queries, which can only reliably cached until the underlying set of objects has been modified. See, eg, BP_Activity_Activity::get().
Parameters Parameters
- $key
-
(Required) Unique key for the query. Usually a SQL string.
- $group
-
(Required) Cache group. Eg 'bp_activity'.
- $ids
-
(Required) Array of IDs.
Return Return
(bool)
Source Source
File: bp-core/bp-core-cache.php
function bp_core_set_incremented_cache( $key, $group, $ids ) { $cache_key = bp_core_get_incremented_cache_key( $key, $group ); return wp_cache_set( $cache_key, $ids, $group ); }
Changelog Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |