5 * Hooks provided by Contextual module.
14 * Alter a contextual links element before it is rendered.
16 * This hook is invoked by contextual_pre_render_links(). The renderable array
17 * of #type 'contextual_links', containing the entire contextual links data that
18 * is passed in by reference. Further links may be added or existing links can
22 * A renderable array representing the contextual links.
24 * An associative array containing the original contextual link items, as
26 * \Drupal\Core\Menu\ContextualLinkManagerInterface::getContextualLinksArrayByGroup(),
27 * which were used to build $element['#links'].
29 * @see hook_contextual_links_alter()
30 * @see hook_contextual_links_plugins_alter()
31 * @see contextual_pre_render_links()
33 function hook_contextual_links_view_alter(&$element, $items) {
34 // Add another class to all contextual link lists to facilitate custom
36 $element['#attributes']['class'][] = 'custom-class';
40 * @} End of "addtogroup hooks".