Foo filter process callback.

The actual filtering is performed here. The supplied text should be returned, once any necessary substitutions have taken place. The example just replaces foo with our custom defined string in the settings page.

Related topics

1 string reference to '_filter_example_filter_foo_process'
filter_example_filter_info in filter_example/filter_example.module
Implements hook_filter_info().

File

filter_example/filter_example.module, line 141
Module file for filter_example.

Code

function _filter_example_filter_foo_process($text, $filter, $format) {
  $replacement = isset($filter->settings['filter_example_foo']) ? $filter->settings['filter_example_foo'] : 'bar';
  return str_replace('foo', $replacement, $text);
}