Created
March 16, 2012 16:21
-
-
Save mynameispj/2050836 to your computer and use it in GitHub Desktop.
Drupal 6 custom module to update all site caches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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