Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContextualHooks.php

function ContextualHooks::contextualLinksViewAlter

Implements hook_contextual_links_view_alter().

See also

\Drupal\contextual\Plugin\views\field\ContextualLinks::render()

File

core/modules/contextual/src/Hook/ContextualHooks.php, line 112

Class

ContextualHooks
Hook implementations for contextual.

Namespace

Drupal\contextual\Hook

Code

public function contextualLinksViewAlter(&$element, $items) : void {
    if (isset($element['#contextual_links']['contextual'])) {
        $encoded_links = $element['#contextual_links']['contextual']['metadata']['contextual-views-field-links'];
        $element['#links'] = Json::decode(rawurldecode($encoded_links));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal