wp-includes/ai-client/adapters/class-wp-ai-client-cache.php:22WordPress-specific PSR-16 cache adapter for the AI Client.
Every hook that fires from inside WP_AI_Client_Cache, in the order it appears in the class, grouped by the method that fires it.
class WP_AI_Client_Cache implements CacheInterface { /** * Cache group used for all cache operations. * * @since 7.0.0 * @var string */ private const CACHE_GROUP = 'wp_ai_client'; /** * Retrieves the cache group used for cache operations, applying a filter for customization. * * @since 7.1.0 * * @return string Cache group name. */ private function get_cache_group(): string { /** * Filters the cache group used by the WP AI Client cache adapter. * * Allows integrators to change the object cache group under which AI client * items are stored. This is useful for avoiding key collisions, creating * environment-specific caches, or adapting to backend constraints. * * @since 7.1.0 * * @param string $group The cache group. */ return (string) apply_filters( 'wp_ai_client_cache_group', self::CACHE_GROUP ); } /** * Fetches a value from the cache. * * @since 7.0.0 * * @param string $key The unique key of this item in the cache. * @param mixed $default_value Default value to return if the key does not exist. * @return mixed The value of the item from the cache, or $default_value in case of cache miss. */ public function get( $key, $default_value = null ) { $found = false; $value = wp_cache_get( $key, $this->get_cache_group(), false, $found ); if ( ! $found ) { return $default_value; } return $value; } /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. * * @since 7.0.0 * * @param string $key The key of the item to store. * @param mixed $value The value of the item to store, must be serializable. * @param null|int|DateInterval $ttl Optional. The TTL value of this item. * @return bool True on success and false on failure. */ public function set( $key, $value, $ttl = null ): bool { $expire = $this->ttl_to_seconds( $ttl ); return wp_cache_set( $key, $value, $this->get_cache_group(), $expire ); } /** * Delete an item from the cache by its unique key. * * @since 7.0.0 * * @param string $key The unique cache key of the item to delete. * @return bool True if the item was successfully removed. False if there was an error. */ public function delete( $key ): bool { return wp_cache_delete( $key, $this->get_cache_group() ); }Introduced in 7.0.0. One change between 7.0.4 and 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
get_cache_group() added.verified against sourcesrc/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.