1 cache.inc _views_fetch_plugin_data($type = NULL, $plugin = NULL, $reset = FALSE)

Fetch the plugin data from cache.

File

core/modules/views/includes/cache.inc, line 127
Load Views' data so that it knows what is available to build queries from.

Code

function _views_fetch_plugin_data($type = NULL, $plugin = NULL, $reset = FALSE) {
  static $cache = NULL;
  if (!isset($cache) || $reset) {
    views_include_handlers();
    $cache = views_discover_plugins();
  }

  if (!$type && !$plugin) {
    return $cache;
  }
  elseif (!$plugin) {
    // Not in the if above so the else below won't run
    if (isset($cache[$type])) {
      return $cache[$type];
    }
  }
  elseif (isset($cache[$type][$plugin])) {
    return $cache[$type][$plugin];
  }

  // Return an empty array if there is no match.
  return array();
}