menu_cache_clear

  1. drupal
    1. 6
    2. 8
    3. 7
Versions
6 – 7 menu_cache_clear($menu_name = 'navigation')

Clears the cached cached data for a single named menu.

Related topics

▾ 3 functions call 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
Helper function for menu_link_delete; deletes a single menu link.

Code

includes/menu.inc, line 2592

<?php
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();
}
?>