bp_core_get_incremented_cache

Gets a value that has been cached using an incremented key.

Description

(array|bool) bp_core_get_incremented_cache( (string) $key, (string) $group ); 

A utility function for use by query methods like BP_Activity_Activity::get().

Returns (array|bool)

False if no cached values are found, otherwise an array of IDs.

Parameters (2)

0. $key (string)
Unique key for the query. Usually a SQL string.
1. $group (string)
Cache group. Eg bp_activity..

Usage

  1. if ( !function_exists( 'bp_core_get_incremented_cache' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-cache.php'; 
  3.  
  4. // Unique key for the query. Usually a SQL string. 
  5. $key = ''; 
  6.  
  7. // Cache group. Eg 'bp_activity'. 
  8. $group = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_core_get_incremented_cache($key, $group); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-cache.php  
  1. function bp_core_get_incremented_cache( $key, $group ) { 
  2. $cache_key = bp_core_get_incremented_cache_key( $key, $group ); 
  3. return wp_cache_get( $cache_key, $group );