function contextual_contextual_links_view_alter

Same name in other branches
  1. 8.9.x core/modules/contextual/contextual.module \contextual_contextual_links_view_alter()
  2. 10 core/modules/contextual/contextual.module \contextual_contextual_links_view_alter()
  3. 11.x core/modules/contextual/contextual.module \contextual_contextual_links_view_alter()

Implements hook_contextual_links_view_alter().

See also

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

File

core/modules/contextual/contextual.module, line 147

Code

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

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