You are here

function gotwo_filter in Go - url redirects 5

Same name and namespace in other branches
  1. 6 gotwo.module \gotwo_filter()

Implementation of hook_filter

File

./gotwo.module, line 168
Module that provides easy to use redirection links. A redirection link would be like: http://examples.org/go/a_label http://examples.org/go/123546 http://examples.org/go/or/like/this

Code

function gotwo_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(
        0 => t('"Go" redirection filter'),
      );
    case 'description':
      return t('Automatically creates redirection urls. <go href=""></go> tags are nicely translated to <a href=""></a> tags.');
    case 'prepare':
      return $text;
    case "process":
      return preg_replace_callback('#<go\\s([^>]*)>(.*?)</go>#is', '_gotwo_filter', $text);
    default:
      return $text;
  }
}