WP_AI_Client_Cache::haspublicWP 7.0.0

Determines whether an item is present in the cache.

Method of the class: WP_AI_Client_Cache{}

No Hooks.

Returns

true|false. True if the item exists in the cache, false otherwise.

Usage

$WP_AI_Client_Cache = new WP_AI_Client_Cache();
$WP_AI_Client_Cache->has( $key ): bool;
$key(string) (required)
The cache item key.

Changelog

Since 7.0.0 Introduced.

WP_AI_Client_Cache::has() code WP 7.0

public function has( $key ): bool {
	$found = false;
	wp_cache_get( $key, self::CACHE_GROUP, false, $found );

	return (bool) $found;
}