function _menu_clear_page_cache
Clears the page and block caches at most twice per page load.
Related topics
3 calls to _menu_clear_page_cache()
- menu_link_save in includes/
menu.inc - Saves a menu link.
- menu_rebuild in includes/
menu.inc - Populates the database tables used by various menu functions.
- _menu_delete_item in includes/
menu.inc - Deletes a single menu link.
File
-
includes/
menu.inc, line 3389
Code
function _menu_clear_page_cache() {
$cache_cleared =& drupal_static(__FUNCTION__, 0);
// Clear the page and block caches, but at most twice, including at
// the end of the page load when there are multiple links saved or deleted.
if ($cache_cleared == 0) {
cache_clear_all();
// Keep track of which menus have expanded items.
_menu_set_expanded_menus();
$cache_cleared = 1;
}
elseif ($cache_cleared == 1) {
drupal_register_shutdown_function('cache_clear_all');
// Keep track of which menus have expanded items.
drupal_register_shutdown_function('_menu_set_expanded_menus');
$cache_cleared = 2;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.