You are here

function cache_actions_action_clear_cache in Cache Actions 7.2

Same name and namespace in other branches
  1. 6.2 cache_actions.rules.inc \cache_actions_action_clear_cache()
  2. 6 cache_actions.rules.inc \cache_actions_action_clear_cache()
  3. 7 cache_actions.rules.inc \cache_actions_action_clear_cache()

This action that clears all cache bins specified.

Parameters

array $bins: The bins to be cleared

Return value

FALSE Return false to avoid problems with rules trying to run save.

1 string reference to 'cache_actions_action_clear_cache'
cache_actions_rules_action_info in ./cache_actions.rules.inc
Implements hook_rules_action_info().

File

./cache_actions.rules.inc, line 430
This file provides the rules integration for this module.

Code

function cache_actions_action_clear_cache($bins) {
  $cache_bins = cache_actions_get_cache_bins();
  foreach ($bins as $bin) {
    if (in_array($bin, $cache_bins)) {
      cache_clear_all('*', $bin, TRUE);
    }
  }

  // Return False to avoid problems with rules trying to run save.
  return FALSE;
}