mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Cache API: Make the placement of wp_cache_flush_group() more consistent.
Includes: * Placing `WP_Object_Cache::flush_group()` next to `::flush()`. * Placing `wp_cache_supports_group_flush()` next to `wp_cache_flush_group()`. * Placing the `wp_cache_flush_group()` unit test next to the `::flush()` method test. * Removing test name from assertion messages, as it is already mentioned directly above in case of failure. * Adjusting function descriptions per the documentation standards. Follow-up to [52706], [53763]. See #55647, #4476. git-svn-id: https://develop.svn.wordpress.org/trunk@53767 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -290,20 +290,6 @@ class WP_Object_Cache {
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all cache items in a group.
|
||||
*
|
||||
* @since 6.1.0
|
||||
*
|
||||
* @param string $group Name of group to remove from cache.
|
||||
* @return true Always returns true.
|
||||
*/
|
||||
public function flush_group( $group ) {
|
||||
unset( $this->cache[ $group ] );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the cache contents, if it exists.
|
||||
*
|
||||
@@ -509,6 +495,20 @@ class WP_Object_Cache {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all cache items in a group.
|
||||
*
|
||||
* @since 6.1.0
|
||||
*
|
||||
* @param string $group Name of group to remove from cache.
|
||||
* @return true Always returns true.
|
||||
*/
|
||||
public function flush_group( $group ) {
|
||||
unset( $this->cache[ $group ] );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list of global cache groups.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user