| 5 filter_example.module | filter_example_filter_tips($delta, $format, $long = FALSE) |
| 6 filter_example.module | filter_example_filter_tips($delta, $format, $long = FALSE) |
Implementation of hook_filter_tips().
This hook allows filters to provide help text to users during the content editing process. Short tips are provided on the content editing screen, while long tips are provided on a separate linked page. Short tips are optional, but long tips are highly recommended.
File
- developer/
examples/ filter_example.module, line 38 - This is an example outlining how a module can be used to define a filter to be run on user-submitted content before it is output to the browser.
Code
function filter_example_filter_tips($delta, $format, $long = FALSE) {
switch ($delta) {
case 0:
if ($long) {
return t('Every instance of "foo" in the input text will be replaced with "%replacement".', array('%replacement' => variable_get('filter_example_foo_' . $format, 'bar')));
}
break;
case 1:
if ($long) {
return t('Every instance of the special <time /> tag will be replaced with the current date and time in the user\'s specified time zone.');
}
else {
return t('Use <time /> to display the current date/time.');
}
break;
}
}
Login or register to post comments