You are here

function _flag_clear_cache in Flag 5

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

Clears various caches when a flag is modified.

2 calls to _flag_clear_cache()
flag_delete_confirm_submit in includes/flag.admin.inc
flag_form_submit in includes/flag.admin.inc
Add/Edit flag form submit.

File

includes/flag.admin.inc, line 447
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();
}