callback_filter_process
function callback_filter_process
callback_filter_process($text, $filter, $format, $langcode, $cache, $cache_id)
Provide text filtered to conform to the supplied format.
Callback for hook_filter_info().
See hook_filter_info() for a description of the filtering process. This step is where the filter actually transforms the text.
Parameters
$text: The text string to be filtered.
$filter: The filter object containing settings for the given format.
$format: The text format object assigned to the text to be filtered.
$langcode: The language code of the text to be filtered.
$cache: A Boolean indicating whether the filtered text is going to be cached in {cache_filter}.
$cache_id: The ID of the filtered text in {cache_filter}, if $cache is TRUE.
Return value
The filtered text.
Related topics
File
- modules/filter/filter.api.php, line 236
- Hooks provided by the Filter module.
Code
function callback_filter_process($text, $filter, $format, $langcode, $cache, $cache_id) { $text = preg_replace('|\[codefilter_code\](.+?)\[/codefilter_code\]|se', "<pre>$1</pre>", $text); return $text; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!filter!filter.api.php/function/callback_filter_process/7.x