You are here

function menu_cache_clear_all in Drupal 8

Same name and namespace in other branches
  1. 6 includes/menu.inc \menu_cache_clear_all()
  2. 7 includes/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.

Deprecated

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal::cache('menu')->invalidateAll() instead.

See also

https://www.drupal.org/node/2989138

Related topics

1 call to menu_cache_clear_all()
MenuLegacyTest::testMenuCacheClearAll in core/tests/Drupal/KernelTests/Core/Menu/MenuLegacyTest.php
Tests deprecation of the menu_cache_clear_all() function.

File

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

Code

function menu_cache_clear_all() {
  @trigger_error("menu_cache_clear_all() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use \\Drupal::cache('menu')->invalidateAll() instead. See https://www.drupal.org/node/2989138", E_USER_DEPRECATED);
  \Drupal::cache('menu')
    ->invalidateAll();
}