function menu_cache_clear

7.x menu.inc menu_cache_clear($menu_name = 'navigation')
6.x 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()
MenuRouterTestCase::testMenuLinkMaintain in drupal/modules/simpletest/tests/menu.test
Tests for menu_link_maintain().
menu_link_save in drupal/includes/menu.inc
Saves a menu link.
_menu_delete_item in drupal/includes/menu.inc
Deletes a single menu link.

File

drupal/includes/menu.inc, line 2687
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();
}