function hook_views_ui_display_top_links_alter

Same name and namespace in other branches
  1. 9 core/modules/views_ui/views_ui.api.php \hook_views_ui_display_top_links_alter()
  2. 8.9.x core/modules/views_ui/views_ui.api.php \hook_views_ui_display_top_links_alter()
  3. 10 core/modules/views_ui/views_ui.api.php \hook_views_ui_display_top_links_alter()

Alter the links displayed at the top of the view edit form.

Parameters

array $links: A renderable array of links which will be displayed at the top of the view edit form. Each entry will be in a form suitable for '#theme' => 'links'.

\Drupal\views\ViewExecutable $view: The view object being edited.

string $display_id: The ID of the display being edited, e.g. 'default' or 'page_1'.

See also

\Drupal\views_ui\ViewUI::renderDisplayTop()

Related topics

1 invocation of hook_views_ui_display_top_links_alter()
ViewEditForm::renderDisplayTop in core/modules/views_ui/src/ViewEditForm.php
Render the top of the display so it can be updated during ajax operations.

File

core/modules/views_ui/views_ui.api.php, line 71

Code

function hook_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id) {
    // Put the export link first in the list.
    if (isset($links['export'])) {
        $links = [
            'export' => $links['export'],
        ] + $links;
    }
}

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