You are here

function menu_cache_clear in Drupal 7

Same name and namespace in other branches
  1. 6 includes/menu.inc \menu_cache_clear()

Clears the cached data for a single named menu.

Related topics

3 calls to menu_cache_clear()
MenuRouterTestCase::testMenuLinkMaintain in modules/simpletest/tests/menu.test
Tests for menu_link_maintain().
menu_link_save in includes/menu.inc
Saves a menu link.
_menu_delete_item in includes/menu.inc
Deletes a single menu link.

File

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