Skip navigation
Help

menu_cache_clear

6 menu.inc menu_cache_clear($menu_name = 'navigation')
7 menu.inc menu_cache_clear($menu_name = 'navigation')

Clears the cached cached data for a single named menu.

Related topics

3 calls to menu_cache_clear()

File

drupal/includes/menu.inc, line 2527
API for the Drupal menu system.

Code

function menu_cache_clear($menu_name = 'navigation') {
  $cache_cleared = &drupal_static(__FUNCTION__, array());

  if (empty($cache_cleared[$menu_name])) {
    cache_clear_all('links:' . $menu_name . ':', 'cache_menu', TRUE);
    $cache_cleared[$menu_name] = 1;
  }
  elseif ($cache_cleared[$menu_name] == 1) {
    drupal_register_shutdown_function('cache_clear_all', 'links:' . $menu_name . ':', 'cache_menu', TRUE);
    $cache_cleared[$menu_name] = 2;
  }

  // Also clear the menu system static caches.
  menu_reset_static_cache();
}