function elf_filter in External Links Filter 5
Same name and namespace in other branches
- 5.3 elf.module \elf_filter()
- 5.2 elf.module \elf_filter()
- 6.3 elf.module \elf_filter()
- 6.2 elf.module \elf_filter()
Implementation of hook_filter().
File
- ./
elf.module, line 58
Code
function elf_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(
0 => t('External links filter'),
);
case 'description':
return t('Adds a CSS class to all external and mailto links.');
case 'process':
// Find all <a> tags and test their href values.
$text = preg_replace_callback('!<a.*?href="([^"]+)".*?>!', 'elf_replace', $text);
return $text;
default:
return $text;
}
}