Commit 5355b183 authored by Erick Hitter's avatar Erick Hitter
Browse files

Remove `wp_cache_increment()` and `wp_cache_decrement()` as they aren't part...

Remove `wp_cache_increment()` and `wp_cache_decrement()` as they aren't part of Core's implementation.

Users switching between cache backends shouldn't have to worry about function names changing. That's not how Core's object cache is designed.
parent 36ce4466
......@@ -43,28 +43,12 @@ function wp_cache_close() {
*
* @return int|bool Returns item's new value on success or FALSE on failure.
*/
function wp_cache_decrement( $key, $offset = 1, $group = '' ) {
function wp_cache_decr( $key, $offset = 1, $group = '' ) {
global $wp_object_cache;
return $wp_object_cache->decrement( $key, $offset, $group );
}
/**
* Decrement a numeric item's value.
*
* Same as wp_cache_decrement. Original WordPress caching backends use wp_cache_decr. I
* want both spellings to work.
*
* @param string $key The key under which to store the value.
* @param int $offset The amount by which to decrement the item's value.
* @param string $group The group value appended to the $key.
*
* @return int|bool Returns item's new value on success or FALSE on failure.
*/
function wp_cache_decr( $key, $offset = 1, $group = '' ) {
return wp_cache_decrement( $key, $offset, $group );
}
/**
* Remove the item from the cache.
*
......@@ -129,28 +113,12 @@ function wp_cache_get_stats() {
*
* @return int|bool Returns item's new value on success or FALSE on failure.
*/
function wp_cache_increment( $key, $offset = 1, $group = '' ) {
function wp_cache_incr( $key, $offset = 1, $group = '' ) {
global $wp_object_cache;
return $wp_object_cache->increment( $key, $offset, $group );
}
/**
* Increment a numeric item's value.
*
* This is the same as wp_cache_increment, but kept for back compatibility. The original
* WordPress caching backends use wp_cache_incr. I want both to work.
*
* @param string $key The key under which to store the value.
* @param int $offset The amount by which to increment the item's value.
* @param string $group The group value appended to the $key.
*
* @return int|bool Returns item's new value on success or FALSE on failure.
*/
function wp_cache_incr( $key, $offset = 1, $group = '' ) {
return wp_cache_increment( $key, $offset, $group );
}
/**
* Replaces a value in cache.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment