By Keith Adler on
I created a .module and .info and placed the following code:
<?php
function test_filter($op, $delta = 0, $format = -1, $text = '') {
if ($op == 'list') {
return array(0 => t('test filter'));
}
switch ($op) {
case 'description':
return t('Test filter.');
case 'prepare':
return $text.' why is this not working?';
case 'process':
return $text.' why is this not working?';
}
}
as described here: http://api.drupal.org/api/HEAD/function/filter_example_filter
However, once I enable the module nothing happens. Do I need to do something differently?
Thank you in advance.
Comments
I have never developed a
I have never developed a filter, but have you enabled the filter for an input format and then applied that input format to some content? Also, have you disabled the cache? Could be little things that are not working.
If they do work I would try to confirm that the function is being called - maybe a drupal_set_message('function called') inside the function but outside the switch and if statement.
At lease then you know whether or not the function is getting invoked correctly.
It's working ... just looking for it in the wrong place
It was under "Home › Administer › Site configuration > Input formats".