You are here

function token_clear_cache in Token 8

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

Clear token caches and static variables.

6 calls to token_clear_cache()
drush_token_cache_clear_token_info in ./token.drush.inc
Clear caches internal to Token module.
TokenCacheController::flush in src/Controller/TokenCacheController.php
Clear caches and redirect back to the frontpage.
token_date_format_delete in ./token.module
Implements hook_ENTITY_TYPE_delete().
token_date_format_insert in ./token.module
Implements hook_ENTITY_TYPE_insert().
token_field_config_delete in ./token.module
Implements hook_ENTITY_TYPE_delete().

... See full list

1 string reference to 'token_clear_cache'
TokenCommands::cacheClear in src/Commands/TokenCommands.php
Adds a cache clear option for tokens.

File

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

Code

function token_clear_cache() {
  \Drupal::token()
    ->resetInfo();
  \Drupal::service('token.entity_mapper')
    ->resetInfo();
  drupal_static_reset('token_menu_link_load_all_parents');
  drupal_static_reset('token_book_link_load');
}