You are here

function hook_freelinking_freelink_alter in Freelinking 4.0.x

Same name and namespace in other branches
  1. 8.3 freelinking.api.php \hook_freelinking_freelink_alter()

Used to alter a freelinking link before passed to the theming system.

Parameters

array &$link: A render array generated by a freelinking plugin. This may be a render array that describes a link or plain markup depending on the plugin.

array $data: An associative array containing information about the content:

  • target: the target string
  • plugin_name: the plugin ID.
  • plugin: The freelinking plugin instance.

See also

\Drupal\freelinking\Plugin\FreelinkingPluginInterface::buildLink()

1 invocation of hook_freelinking_freelink_alter()
FreelinkingManager::buildLink in src/FreelinkingManager.php
Build link structure for a plugin with target parameters.

File

./freelinking.api.php, line 39
API documentation for Freelinking.

Code

function hook_freelinking_freelink_alter(array &$link, array $data) {
  $link['#attributes']['class'][] = 'active';
}