WP_Site_Health::available_object_cache_services()privateWP 6.1.0

Returns a list of available persistent object cache services.

Метод класса: WP_Site_Health{}

Хуки из метода

Возвращает

Строку[]. The list of available persistent object cache services.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->available_object_cache_services();

Список изменений

С версии 6.1.0 Введена.

Код WP_Site_Health::available_object_cache_services() WP 6.5.2

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 );
}