8.5.x menu.inc menu_cache_clear_all()
8.0.x menu.inc menu_cache_clear_all()
8.1.x menu.inc menu_cache_clear_all()
8.2.x menu.inc menu_cache_clear_all()
8.3.x menu.inc menu_cache_clear_all()
8.4.x menu.inc menu_cache_clear_all()
8.6.x menu.inc menu_cache_clear_all()
6.x menu.inc menu_cache_clear_all()
7.x menu.inc menu_cache_clear_all()

Clears all cached menu data.

This should be called any time broad changes might have been made to the router items or menu links.

Related topics

3 calls to menu_cache_clear_all()
menu_ui_menu_delete in core/modules/menu_ui/menu_ui.module
Implements hook_ENTITY_TYPE_delete() for menu entities.
menu_ui_menu_insert in core/modules/menu_ui/menu_ui.module
Implements hook_ENTITY_TYPE_insert( for menu entities.
menu_ui_menu_update in core/modules/menu_ui/menu_ui.module
Implements hook_ENTITY_TYPE_update() for menu entities.

File

core/includes/menu.inc, line 165
API for the Drupal menu system.

Code

function menu_cache_clear_all() {
  \Drupal::cache('menu')
    ->invalidateAll();
}