views_form_views_exposed_form_alter

views_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) Implements hook_form_alter() for the exposed form. Since the exposed form is a GET form, we don't want it to send a wide variety of information. File core/modules/views/views.module, line 643 Primarily Drupal hooks and global API functions to manipulate views. Code function views_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) { $form['form_build_id']['#access'] = FALSE; $form['form_t

views_field_default_views_data

views_field_default_views_data(FieldStorageConfigInterface $field_storage) Default views data implementation for a field. Parameters \Drupal\field\FieldStorageConfigInterface $field_storage: The field definition. Return value array The default views data for the field. File core/modules/views/views.views.inc, line 287 Provide views data that isn't tied to any other module. Code function views_field_default_views_data(FieldStorageConfigInterface $field_storage) { $data = array(); // Che

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_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_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_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_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_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

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(); }