filter_example_filter_tips

  1. drupal
    1. 4.7 filter_example.module
    2. 5 filter_example.module
    3. 6
Versions
4.7 – 6 filter_example_filter_tips($delta, $format, $long = FALSE)

Implementation of hook_filter_tips().

This hook allows filters to provide help text to users during the content editing process. Short tips are provided on the content editing screen, while long tips are provided on a separate linked page. Short tips are optional, but long tips are highly recommended.

Related topics

Code

examples/filter_example/filter_example.module, line 38

<?php
function filter_example_filter_tips($delta, $format, $long = FALSE) {
  switch ($delta) {
    case 0:
      if ($long) {
        return t('Every instance of "foo" in the input text will be replaced with "%replacement".', array('%replacement' => variable_get('filter_example_foo_' . $format, 'bar')));
      }
      break;

    case 1:
      if ($long) {
        return t('Every instance of the special &lt;time /&gt; tag will be replaced with the current date and time in the user\'s specified time zone.');
      }
      else {
        return t('Use &lt;time /&gt; to display the current date/time.');
      }
      break;
  }
}
?>