You are here

function _cache_actions_clear_view_display in Cache Actions 7.2

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

Clear out a specific display in a view.

Parameters

view $view: The view to clear the display.

views_plugin_display $display: The views display to clear.

2 calls to _cache_actions_clear_view_display()
cache_actions_action_clear_views_display_cache in ./cache_actions.rules.inc
This action clears the cache of a specific view display.
_cache_actions_clear_view in ./cache_actions.rules.inc
Clear out a view and it's displays.

File

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

Code

function _cache_actions_clear_view_display($view, $display) {

  // We use the cache plugin to clear the cache.
  $view
    ->set_display($display->id);
  $cache_plugin = views_get_plugin('cache', $display->display_options['cache']['type']);

  // If we have a cache plugin, then initiate it and flush the cache.
  if (isset($cache_plugin)) {
    $cache_plugin
      ->init($view, $display);
    $cache_plugin
      ->cache_flush();
  }
}