function twitter_filter in Twitter 6.2
Same name and namespace in other branches
- 6.5 twitter.module \twitter_filter()
- 6.3 twitter.module \twitter_filter()
- 6.4 twitter.module \twitter_filter()
Implementation of hook_filter().
- Twitter @username converter: .Converts Twitter-style @usernames into links to Twitter account pages.
- Twitter #hashtag converter: .Converts Twitter-style #hashtags into links to hashtags.org.
File
- ./
twitter.module, line 204
Code
function twitter_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(
0 => t('Twitter @username converter'),
1 => t('Twitter #hashtag converter'),
);
case 'description':
switch ($delta) {
case 0:
return t('Converts Twitter-style @usernames into links to Twitter account pages.');
case 1:
return t('Converts Twitter-style #hashtags into links to hashtags.org.');
default:
return;
}
case 'process':
switch ($delta) {
case 0:
return twitter_link_filter($text);
case 1:
return twitter_link_filter($text, '#', 'http://search.twitter.com/search?q=%23');
default:
return $text;
}
default:
return $text;
}
}