Skip to:
Content

BuddyPress.org

Changeset 11864


Ignore:
Timestamp:
02/27/2018 01:29:26 PM (4 years ago)
Author:
dcavins
Message:

Introduce bp_core_delete_incremented_cache().

Add a convenience function for deleting cache items that use bp_core_get_incremented_cache_key() to generate their keys.

See #7436.

File:
1 edited

Legend:

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

    r11513 r11864  
    308308
    309309/**
     310 * Delete a value that has been cached using an incremented key.
     311 *
     312 * A utility function for use by query methods like BP_Activity_Activity::get().
     313 *
     314 * @since 3.0.0
     315 * @see bp_core_set_incremented_cache()
     316 *
     317 * @param string $key   Unique key for the query. Usually a SQL string.
     318 * @param string $group Cache group. Eg 'bp_activity'.
     319 * @return bool True on successful removal, false on failure.
     320 */
     321function bp_core_delete_incremented_cache( $key, $group ) {
     322    $cache_key = bp_core_get_incremented_cache_key( $key, $group );
     323    return wp_cache_delete( $cache_key, $group );
     324}
     325
     326/**
    310327 * Gets the key to be used when caching a value using an incremented cache key.
    311328 *
Note: See TracChangeset for help on using the changeset viewer.