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

ViewsWizard::$id

The plugin ID. Type: string File core/modules/views/src/Annotation/ViewsWizard.php, line 22 Class ViewsWizard Defines a Plugin annotation object for views wizard plugins. Namespace Drupal\views\Annotation Code public $id;

views_add_contextual_links

views_add_contextual_links(&$render_element, $location, $display_id, array $view_element = NULL) Adds contextual links associated with a view display to a renderable array. This function should be called when a view is being rendered in a particular location and you want to attach the appropriate contextual links (e.g., links for editing the view) to it. The function operates by checking the view's display plugin to see if it has defined any contextual links that are intended to be displaye