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().

Top ↑

Parameters Parameters


(string) (Required) Unique key for the query. Usually a SQL string.


(string) (Required) Cache group. Eg 'bp_activity'.


(array) (Required) Array of IDs.

Top ↑

Return Return


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 );

Top ↑

Changelog Changelog

Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.