Skip to content

Commit

Permalink
Declare wp_cache_supports function and support features (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
John Spellman committed Dec 2, 2022
1 parent bbab819 commit b3b5291
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,31 @@ function wp_cache_reset() {
return $wp_object_cache->reset();
}

/**
* Determines whether the object cache implementation supports a particular feature.
*
* @since 6.1.0
*
* @param string $feature Name of the feature to check for. Possible values include:
* 'add_multiple', 'set_multiple', 'get_multiple', 'delete_multiple',
* 'flush_runtime', 'flush_group'.
* @return bool True if the feature is supported, false otherwise.
*/
function wp_cache_supports( $feature ) {
switch ( $feature ) {
case 'add_multiple':
case 'set_multiple':
case 'get_multiple':
case 'delete_multiple':
case 'flush_runtime':
case 'flush_group':
return true;

default:
return false;
}
}

/**
* WordPress Object Cache
*
Expand Down

0 comments on commit b3b5291

Please sign in to comment.