On this page
WP_Site_Health::available_object_cache_services(): string[]
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Returns a list of available persistent object cache services.
Return
string[] The list of available persistent object cache services.
Source
File: wp-admin/includes/class-wp-site-health.php. View all references
private function available_object_cache_services() {
$extensions = array_map(
'extension_loaded',
array(
'APCu' => 'apcu',
'Redis' => 'redis',
'Relay' => 'relay',
'Memcache' => 'memcache',
'Memcached' => 'memcached',
)
);
$services = array_keys( array_filter( $extensions ) );
/**
* Filters the persistent object cache services available to the user.
*
* This can be useful to hide or add services not included in the defaults.
*
* @since 6.1.0
*
* @param string[] $services The list of available persistent object cache services.
*/
return apply_filters( 'site_status_available_object_cache_services', $services );
}
Hooks
- apply_filters( 'site_status_available_object_cache_services',
string[] $services ) -
Filters the persistent object cache services available to the user.
Related
Uses
| Uses | Description |
|---|---|
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
Used By
| Used By | Description |
|---|---|
| WP_Site_Health::get_test_persistent_object_cache() wp-admin/includes/class-wp-site-health.php | Tests if the site uses persistent object cache and recommends to use it if not. |
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_site_health/available_object_cache_services