You are here

function hook_freelink_alter in Freelinking 6.3

Same name and namespace in other branches
  1. 7.3 freelinking.api.php \hook_freelink_alter()

hook_freelink_alter() is used to modify the array of link values that are eventually passed on to the theme functions to become links.

Error messages and strings returned from plugins are not processed by this hook. Errors are directly themed and returned, and strings are simply passed back to the text. (In the latter "mode", freelinking could be used to generate something other than a link.)

@plugin The plugin definition (array) of the freelinking plugin that created the current link.

Parameters

$link: Array suitable for passing to l().

$target: Array of information from parsed linking syntax.

$plugin_name: String of the name of the freelinking plugin that created the current link.

Return value

Array suitable for passing to l().

See also

http://drupal.org/node/???

1 function implements hook_freelink_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

freelinking_freelink_alter in ./freelinking.module
Implementation of hook_freelink_alter(). Used here to clean up and standardize links.
1 invocation of hook_freelink_alter()
_freelinking_build_freelink in ./freelinking.module
Construct a link out of the $target with the specified plugin

File

./freelinking.api.php, line 53
Freelinking 3 API

Code

function hook_freelink_alter(&$link, $target, $plugin_name, $plugin) {
  if ($plugin_name == 'stark_link') {
    unset($link[2]['attributes']['class']);
    unset($link[2]['attributes']['title']);
  }
  elseif ($plugin_name == 'green_link') {
    $link[2]['attributes']['class'] .= ' green';
  }
}