You are here

function hook_admin_menu_cache_info in Administration menu 7.3

Same name and namespace in other branches
  1. 8.3 admin_menu.api.php \hook_admin_menu_cache_info()
  2. 6.3 admin_menu.api.php \hook_admin_menu_cache_info()

Inform about additional module-specific caches that can be cleared.

Administration menu uses this hook to gather information about available caches that can be flushed individually. Each returned item forms a separate menu link below the "Flush all caches" link in the icon menu.

Return value

array An associative array whose keys denote internal identifiers for a particular caches (which can be freely defined, but should be in a module's namespace) and whose values are associative arrays containing:

  • title: The name of the cache, without "cache" suffix. This label is output as link text, but also for the "!title cache cleared." confirmation message after flushing the cache; make sure it works and makes sense to users in both locations.
  • callback: The name of a function to invoke to flush the individual cache.
3 functions implement hook_admin_menu_cache_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

admin_menu_admin_menu_cache_info in ./admin_menu.inc
Implements hook_admin_menu_cache_info().
system_admin_menu_cache_info in ./admin_menu.inc
Implements hook_admin_menu_cache_info() on behalf of System module.
update_admin_menu_cache_info in ./admin_menu.inc
Implements hook_admin_menu_cache_info() on behalf of Update module.
2 invocations of hook_admin_menu_cache_info()
admin_menu_flush_cache in ./admin_menu.inc
Flush all caches or a specific one.
admin_menu_links_icon in ./admin_menu.inc
Build icon menu links; mostly containing maintenance helpers.

File

./admin_menu.api.php, line 158
API documentation for Administration menu.

Code

function hook_admin_menu_cache_info() {
  $caches['update'] = array(
    'title' => t('Update data'),
    'callback' => '_update_cache_clear',
  );
  return $caches;
}