You are here

function views_hook_info in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/views.module \views_hook_info()

Implements hook_hook_info().

File

core/modules/views/views.module, line 536
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_hook_info() {
  $hooks = [];
  $hooks += array_fill_keys([
    'views_data',
    'views_data_alter',
    'views_analyze',
    'views_invalidate_cache',
  ], [
    'group' => 'views',
  ]);

  // Register a views_plugins alter hook for all plugin types.
  foreach (ViewExecutable::getPluginTypes() as $type) {
    $hooks['views_plugins_' . $type . '_alter'] = [
      'group' => 'views',
    ];
  }
  $hooks += array_fill_keys([
    'views_query_substitutions',
    'views_form_substitutions',
    'views_pre_view',
    'views_pre_build',
    'views_post_build',
    'views_pre_execute',
    'views_post_execute',
    'views_pre_render',
    'views_post_render',
    'views_query_alter',
  ], [
    'group' => 'views_execution',
  ]);
  $hooks['field_views_data'] = [
    'group' => 'views',
  ];
  $hooks['field_views_data_alter'] = [
    'group' => 'views',
  ];
  return $hooks;
}