Title: WP_AI_Client_Cache::get_cache_group
Published: August 20, 2026

---

# WP_AI_Client_Cache::get_cache_group(): string

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Retrieves the cache group used for cache operations, applying a filter for customization.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#return)󠁿

 string Cache group name.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php#L39)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php#L39-L52)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#hooks)󠁿

 [apply_filters( ‘wp_ai_client_cache_group’, string $group )](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/)

Filters the cache group used by the WP AI Client cache adapter.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [WP_AI_Client_Cache::getMultiple()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/getmultiple/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Obtains multiple cache items by their unique keys.

  | 
| [WP_AI_Client_Cache::setMultiple()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/setmultiple/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Persists a set of key => value pairs in the cache, with an optional TTL.

  | 
| [WP_AI_Client_Cache::deleteMultiple()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/deletemultiple/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Deletes multiple cache items in a single operation.

  | 
| [WP_AI_Client_Cache::has()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/has/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Determines whether an item is present in the cache.

  | 
| [WP_AI_Client_Cache::get()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Fetches a value from the cache.

  | 
| [WP_AI_Client_Cache::set()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/set/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.

  | 
| [WP_AI_Client_Cache::delete()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/delete/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Delete an item from the cache by its unique key.

  | 
| [WP_AI_Client_Cache::clear()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/clear/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Wipes clean the entire cache’s keys.

  |

[Show 3 more](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_ai_client_cache%2Fget_cache_group%2F)
before being able to contribute a note or feedback.