function contextual_contextual_links_view_alter in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 143 - Adds contextual links to perform actions related to elements on a page.
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));
}
}