1 filter_example.module _filter_example_filter_foo_settings($form, $form_state, $filter, $format)

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 parameter.

Related topics


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


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