Skip to content

Instantly share code, notes, and snippets.

@mynameispj
Created March 16, 2012 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mynameispj/2050836 to your computer and use it in GitHub Desktop.
Save mynameispj/2050836 to your computer and use it in GitHub Desktop.
Drupal 6 custom module to update all site caches
function z_masterfit_ui_customized_menu() {
$items = array();
$items['admin/flush-cache'] = array(
'type' => MENU_NORMAL_ITEM,
'title' => t('Flush the cache'),
'description' => 'Flush all website caches to make sure it updates to relect '.
'your recent changes.',
'page callback' => 'flush_cache_custom_callback',
'access callback' => user_access('flush cache'),
);
return $items;
}
function z_masterfit_ui_customized_perm() {
return array('flush cache');
}
function flush_cache_custom_callback() {
drupal_flush_all_caches();
drupal_set_message('Cache cleared.');
drupal_goto('admin');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment