1 filter_example.module filter_example_filter_info()

Implements hook_filter_info().

We define the different filters provided by the module. For this example, time_filter is a very static and simple replacement, but it requires preparing the string because of the < and > characters. foo_filter is more complex.

Related topics

File

modules/examples/filter_example/filter_example.module, line 72
Hook implementations for the Filter Example module.

Code

function filter_example_filter_info() {
  $filters['filter_foo'] = array(
    'title' => t('Foo Filter (example)'),
    'description' => t('Every instance of "foo" in the input text will be replaced with a preconfigured replacement.'),
    'process callback' => '_filter_example_filter_foo_process',
    'default settings' => array(
      'filter_example_foo' => 'bar',
    ),
    'settings callback' => '_filter_example_filter_foo_settings',
    'tips callback' => '_filter_example_filter_foo_tips',
  );
  $filters['filter_time'] = array(
    'title' => t('Time Tag (example)'),
    'description' => 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."),
    'prepare callback' => '_filter_example_filter_time_prepare',
    'process callback' => '_filter_example_filter_time_process',
    'tips callback' => '_filter_example_filter_time_tips',
  );
  return $filters;
}