views_hook_info

views_hook_info() Implements hook_hook_info(). File core/modules/views/views.module, line 510 Primarily Drupal hooks and global API functions to manipulate views. Code function views_hook_info() { $hooks = array(); $hooks += array_fill_keys(array( 'views_data', 'views_data_alter', 'views_analyze', 'views_invalidate_cache', ), array('group' => 'views')); // Register a views_plugins alter hook for all plugin types. foreach (ViewExecutable::getPluginTypes() as $typ

views_get_current_view

&views_get_current_view() Find out what, if any, current view is currently in use. Note that this returns a reference, so be careful! You can unintentionally modify the $view object. Return value \Drupal\views\ViewExecutable The current view object. File core/modules/views/views.module, line 503 Primarily Drupal hooks and global API functions to manipulate views. Code function &views_get_current_view() { return views_set_current_view(); }

views_field_config_insert

views_field_config_insert(FieldConfigInterface $field) Implements hook_ENTITY_TYPE_insert() for 'field_config'. File core/modules/views/views.module, line 440 Primarily Drupal hooks and global API functions to manipulate views. Code function views_field_config_insert(FieldConfigInterface $field) { Views::viewsData()->clear(); }

views_field_config_update

views_field_config_update(FieldConfigInterface $field) Implements hook_ENTITY_TYPE_update() for 'field_config'. File core/modules/views/views.module, line 447 Primarily Drupal hooks and global API functions to manipulate views. Code function views_field_config_update(FieldConfigInterface $field) { Views::viewsData()->clear(); }

views_field_config_delete

views_field_config_delete(FieldConfigInterface $field) Implements hook_ENTITY_TYPE_delete() for 'field_config'. File core/modules/views/views.module, line 454 Primarily Drupal hooks and global API functions to manipulate views. Code function views_field_config_delete(FieldConfigInterface $field) { Views::viewsData()->clear(); }

views_embed_view

views_embed_view($name, $display_id = 'default') Embed a view using a PHP snippet. This function is meant to be called from PHP snippets, should one wish to embed a view in a node or something. It's meant to provide the simplest solution and doesn't really offer a lot of options, but breaking the function apart is pretty easy, and this provides a worthwhile guide to doing so. Note that this function does NOT display the title of the view. If you want to do that, you will need to do what this fu

views_entity_field_label

views_entity_field_label($entity_type, $field_name) Returns the label of a certain field. Therefore it looks up in all bundles to find the most used field. File core/modules/views/views.views.inc, line 247 Provide views data that isn't tied to any other module. Code function views_entity_field_label($entity_type, $field_name) { $label_counter = array(); $all_labels = array(); // Count the amount of fields per label per field storage. foreach (array_keys(\Drupal::entityManager()->ge

views_enable_view

views_enable_view(View $view) Enables and saves a view. Parameters \Drupal\views\Entity\View $view: The View object to disable. File core/modules/views/views.module, line 582 Primarily Drupal hooks and global API functions to manipulate views. Code function views_enable_view(View $view) { $view->enable()->save(); }

views_disable_view

views_disable_view(View $view) Disables and saves a view. Parameters \Drupal\views\Entity\View $view: The View object to disable. File core/modules/views/views.module, line 592 Primarily Drupal hooks and global API functions to manipulate views. Code function views_disable_view(View $view) { $view->disable()->save(); }

views_element_validate_tags

views_element_validate_tags($element, FormStateInterface $form_state) Validation callback for query tags. File core/modules/views/views.module, line 798 Primarily Drupal hooks and global API functions to manipulate views. Code function views_element_validate_tags($element, FormStateInterface $form_state) { $values = array_map('trim', explode(',', $element['#value'])); foreach ($values as $value) { if (preg_match("/[^a-z_]/", $value)) { $form_state->setError($element, t('The q