function ViewsUiHooks::viewsPluginsDisplayAlter

Implements hook_views_plugins_display_alter().

Attributes

#[Hook('views_plugins_display_alter')]

File

core/modules/views_ui/src/Hook/ViewsUiHooks.php, line 160

Class

ViewsUiHooks
Hook implementations for views_ui.

Namespace

Drupal\views_ui\Hook

Code

public function viewsPluginsDisplayAlter(&$plugins) : void {
  // Attach contextual links to each display plugin. The links will point to
  // paths underneath "admin/structure/views/view/{$view->id()}" (i.e., paths
  // for editing and performing other contextual actions on the view).
  foreach ($plugins as &$display) {
    $display['contextual links']['entity.view.edit_form'] = [
      'route_name' => 'entity.view.edit_form',
      'route_parameters_names' => [
        'view' => 'id',
      ],
    ];
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.