You are here

function _flag_clear_cache in Flag 7.2

Same name and namespace in other branches
  1. 5 includes/flag.admin.inc \_flag_clear_cache()
  2. 6.2 includes/flag.admin.inc \_flag_clear_cache()
  3. 6 includes/flag.admin.inc \_flag_clear_cache()
  4. 7.3 includes/flag.admin.inc \_flag_clear_cache()

Clears various caches when a flag is modified.

4 calls to _flag_clear_cache()
flag_delete_confirm_submit in includes/flag.admin.inc
flag_features_revert in includes/flag.features.inc
Implements hook_features_revert().
flag_form_submit in includes/flag.admin.inc
Add/Edit flag form submit.
flag_import_form_submit in includes/flag.export.inc
Submit handler; Import a flag.

File

includes/flag.admin.inc, line 655
Contains administrative pages for creating, editing, and deleting flags.

Code

function _flag_clear_cache() {
  if (module_exists('views')) {
    views_invalidate_cache();
  }

  // Reset our flags cache, thereby making the following code aware of the
  // modifications.
  flag_get_flags(NULL, NULL, NULL, TRUE);

  // The title of a flag may appear in the menu (indirectly, via our "default
  // views"), so we need to clear the menu cache. This call also clears the
  // page cache, which is desirable too because the flag labels may have
  // changed.
  menu_rebuild();
}