function hook_freelink_alter in Freelinking 7.3
Same name and namespace in other branches
- 6.3 freelinking.api.php \hook_freelink_alter()
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.)
Parameters
$link: Array suitable for passing to l().
$context: Array of information from parsed linking syntax.
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 - Implements 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 38 - API documentation for Freelinking.
Code
function hook_freelink_alter(&$link, $context) {
$plugin_name = $context['plugin_name'];
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';
}
}