You are here

function token_clear_cache in Token 7

Same name and namespace in other branches
  1. 8 token.module \token_clear_cache()

Clear token caches and static variables.

5 calls to token_clear_cache()
drush_token_cache_clear_token_info in ./token.drush.inc
Clear caches internal to Token module.
token_field_create_instance in ./token.module
Implements hook_field_create_instance().
token_field_delete_instance in ./token.module
Implements hook_field_delete_instance().
token_field_update_instance in ./token.module
Implements hook_field_update_instance().
token_flush_cache_callback in ./token.pages.inc
Page callback to clear the token registry caches.
1 string reference to 'token_clear_cache'
token_form_alter in ./token.module
Implements hook_form_alter().

File

./token.module, line 362
Enhances the token API in core: adds a browseable UI, missing tokens, etc.

Code

function token_clear_cache() {
  if (db_table_exists('cache_token')) {
    cache_clear_all('*', 'cache_token', TRUE);
  }
  drupal_static_reset('token_get_info');
  drupal_static_reset('token_get_global_token_types');
  drupal_static_reset('token_get_entity_mapping');
  drupal_static_reset('token_build_tree');
  drupal_static_reset('_token_profile_fields');
  drupal_static_reset('token_menu_link_load');
  drupal_static_reset('token_book_link_load');
  drupal_static_reset('token_node_menu_link_load');
  drupal_static_reset('_token_field_info');
}