1.20.x views.theme.inc _views_theme_functions($hook, $view, $display = NULL)

Provide a full array of possible themes to try for a given hook.

Parameters

$hook: The hook to use. This is the base theme/template name.

$view: The view being rendered.

$display: The display being rendered, if applicable.

File

modules/views/templates/views.theme.inc, line 17
Preprocessors and helper functions to make theme development easier.

Code

function _views_theme_functions($hook, $view, $display = NULL) {
  $themes = array();

  if ($display) {
    $themes[] = $hook . '__' . $view->name . '__' . $display->id;
    $themes[] = $hook . '__' . $display->id;
    $themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '_', strtolower($view->tag));

    // Add theme suggestions foreach single tag.
    foreach (backdrop_explode_tags($view->tag) as $tag) {
      $themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '_', strtolower($tag));
    }

    if ($display->id != $display->display_plugin) {
      $themes[] = $hook . '__' . $view->name . '__' . $display->display_plugin;
      $themes[] = $hook . '__' . $display->display_plugin;
    }
  }
  $themes[] = $hook . '__' . $view->name;
  $themes[] = $hook;
  return $themes;
}