Settings callback for foo filter.

Make use of $format to have different replacements for every input format. Since we allow the administrator to define the string that gets substituted when "foo" is encountered, we need to provide an interface for this kind of customization. The object format is also an argument of the callback.

The settings defined in this form are stored in database by the filter module, and they will be available in the $filter argument.

Related topics

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

File

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

Code

function _filter_example_filter_foo_settings($form, $form_state, $filter, $format, $defaults) {
  $settings['filter_example_foo'] = array(
    '#type' => 'textfield',
    '#title' => t('Substitution string'),
    '#default_value' => isset($filter->settings['filter_example_foo']) ? $filter->settings['filter_example_foo'] : $defaults['filter_example_foo'],
    '#description' => t('The string to substitute for "foo" everywhere in the text.'),
  );
  return $settings;
}