How to convert hook_filter and hook_filter_tips in Drupal 7? I have trouble converting my custom modules in D7. Found a how-to here http://drupal.org/node/224333 but not so clear to me. This how my code in D6.

/**
 * Implementation of hook_filter().
 */
function custom_inline_filter($op, $delta = 0, $format = -1, $text = '') {

  switch ($op) {
    case 'list':
      return array(0 =&gt; t('Custom Inline Filter'));

    case 'description':
      return t('Substitutes @inline tags with the uploaded inline images of the node.', array('@inline' =&gt; '&lt;!-- INLINE --&gt;'));

    case 'settings':
      break;

    case 'no cache':
      return FALSE;

    case 'prepare':    
      return $text;

    case 'process':
      return custom_inline_substitute($text);
      break;

    default:
      return $text;
  }
}


/**
 * Substitute inline image placeholder comments with inline image divs.
 * This function is usually called by hook_filter.process but also by template.php (used for RSS).
 *
 * @param $content
 * @param $node_id
 * @param $rss
 */
function custom_inline_substitute($content, $node_id = NULL, $rss = FALSE) {

  // Get nid from argument

  if ($node_id) {
    $nid = $node_id;
  }
  // Get nid when a node is displayed

  elseif (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))) {
    $nid = arg(1);
  }
  else {
    return $content;
  }

  // Instantiate inline image class

  $inlineImg = new CustomInlineImage($nid, $rss);
  return $inlineImg-&gt;substitute($content);
}


/**
 * Implementation of hook_filter_tips().
 */
function custom_inline_filter_tips($delta, $format, $long = FALSE) {

  if ($long) {
    return t('You may link to uploaded images within the current node using the wysiwyg editor toolbar icons.
      The Custom Inline Filter is to replace added image placeholders with uploaded inline images.'
    );
  }
  else {
    return t('Use the wysiwyg editor toolbar icons to display uploaded images inline.');
  }
}
The code you should use in Drupal 7 is similar to the following one.

function custom_inline_filter_info() {
  $filters['custom_inline_filter'] = array(
    'title' =&gt; t('Custom Inline Filter'), 
    'description' =&gt; t('Substitutes @inline tags with the uploaded inline images of the node.', array('@inline' =&gt; '&lt;!-- INLINE --&gt;')),
    'cache' =&gt; TRUE, 
    'process callback' =&gt; 'custom_inline_substitute', 
    'tips callback' =&gt; 'custom_inline_filter_tips',
  );

  return $filters;
}

function custom_inline_substitute($text, $filter, $format, $langcode, $cache, $cache_id) {
  // …
}

function custom_inline_filter_tips($filter, $format, $long) {
  if ($long) {
    return t('You may link to uploaded images within the current node using the wysiwyg editor toolbar icons.
      The Custom Inline Filter is to replace added image placeholders with uploaded inline images.'
    );
  }
  else {
    return t('Use the wysiwyg editor toolbar icons to display uploaded images inline.');
  }
}


The documentation for the input filter implementations is provided in more than one page:


hook_filter_info()
hook_filter_FILTER_settings()
hook_filter_FILTER_prepare()
hook_filter_FILTER_process()
hook_filter_FILTER_tips()


For the parameters passed to the callbacks defined from an input filter module, see hook_filter_FILTER_settings(), hook_filter_FILTER_prepare(), hook_filter_FILTER_process(), and hook_filter_FILTER_tips().
In particular, it is relevant to know that:


$filter is a filter object, not a string that identifies the input filter; it contains information about the input filter, but what an input filter implementation normally uses is $filter-&gt;settings, which is an array of settings defined from the input filter.
$format is a format object, described in filter_format_save(); it doesn't contain information that an input filter normally uses.


To notice that only the first one is actually a hook; the others are callbacks. The documentation shows them as hooks because a limit of the module used to add documentation pages on Drupal.org API: A documentation page is added only if the function is contained in a module (a Drupal core module, or a third-party module), or it is a hook described in a .api.php file.