bp_core_get_incremented_cache_key( string $key, string $group )

Gets the key to be used when caching a value using an incremented cache key.

Description

The $key is hashed with a component-specific incrementor, which is used to invalidate multiple caches at once.

Parameters

$key

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

$group

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

Return

(string)

Source

File: bp-core/bp-core-cache.php

function bp_core_get_incremented_cache_key( $key, $group ) {
	$incrementor = bp_core_get_incrementor( $group );
	$cache_key = md5( $key . $incrementor );
	return $cache_key;
}

Changelog

Changelog
Version Description
BuddyPress 2.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.