You are here

function cache_actions_action_clear_views_cache in Cache Actions 7.2

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

This action clears the cache of a specific view.

Parameters

array $views: The views to clear.

Return value

VOID|FALSE Returns false if views is disabled.

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

File

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

Code

function cache_actions_action_clear_views_cache($views) {
  if (module_exists('views')) {
    views_include_handlers();
    module_load_include('inc', 'views', 'plugins/views_plugin_cache');

    // Is this an array?
    if (is_array($views)) {
      foreach ($views as $view) {
        _cache_actions_clear_view($view);
      }
    }
    else {

      // Otherwise it's probably an old rule from 1.x, let's just handle that.
      _cache_actions_clear_view($views);
    }
  }
  return FALSE;
}