wp/wp-includes/cache.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
   280 function wp_cache_flush_runtime() {
   280 function wp_cache_flush_runtime() {
   281 	return wp_cache_flush();
   281 	return wp_cache_flush();
   282 }
   282 }
   283 
   283 
   284 /**
   284 /**
       
   285  * Removes all cache items in a group, if the object cache implementation supports it.
       
   286  *
       
   287  * Before calling this function, always check for group flushing support using the
       
   288  * `wp_cache_supports( 'flush_group' )` function.
       
   289  *
       
   290  * @since 6.1.0
       
   291  *
       
   292  * @see WP_Object_Cache::flush_group()
       
   293  * @global WP_Object_Cache $wp_object_cache Object cache global instance.
       
   294  *
       
   295  * @param string $group Name of group to remove from cache.
       
   296  * @return bool True if group was flushed, false otherwise.
       
   297  */
       
   298 function wp_cache_flush_group( $group ) {
       
   299 	global $wp_object_cache;
       
   300 
       
   301 	return $wp_object_cache->flush_group( $group );
       
   302 }
       
   303 
       
   304 /**
       
   305  * Determines whether the object cache implementation supports a particular feature.
       
   306  *
       
   307  * @since 6.1.0
       
   308  *
       
   309  * @param string $feature Name of the feature to check for. Possible values include:
       
   310  *                        'add_multiple', 'set_multiple', 'get_multiple', 'delete_multiple',
       
   311  *                        'flush_runtime', 'flush_group'.
       
   312  * @return bool True if the feature is supported, false otherwise.
       
   313  */
       
   314 function wp_cache_supports( $feature ) {
       
   315 	switch ( $feature ) {
       
   316 		case 'add_multiple':
       
   317 		case 'set_multiple':
       
   318 		case 'get_multiple':
       
   319 		case 'delete_multiple':
       
   320 		case 'flush_runtime':
       
   321 		case 'flush_group':
       
   322 			return true;
       
   323 
       
   324 		default:
       
   325 			return false;
       
   326 	}
       
   327 }
       
   328 
       
   329 /**
   285  * Closes the cache.
   330  * Closes the cache.
   286  *
   331  *
   287  * This function has ceased to do anything since WordPress 2.5. The
   332  * This function has ceased to do anything since WordPress 2.5. The
   288  * functionality was removed along with the rest of the persistent cache.
   333  * functionality was removed along with the rest of the persistent cache.
   289  *
   334  *