Filter: bricks/get_templates_query/cache_key
Filters the cache key used by Templates::get_templates_query() to store and retrieve template queries. Use this to create unique cache entries when modifying the template query arguments based on custom context (e.g., user role, language).
Parameters
Section titled “Parameters”$cache_key(string): The unique cache key string.
Example usage
Section titled “Example usage”add_filter( 'bricks/get_templates_query/cache_key', function( $cache_key ) { // Example: Append current user role to cache key $user = wp_get_current_user(); $role = ( array ) $user->roles;
return $cache_key . '_' . implode( '-', $role );} );Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.