This module allows you to insert dynamic content into text by defining custom functions. You can then use a simple tag like `[function:my_function]` within your text to have the output of your defined function automatically inserted.
Text filter for replace tokens [function:*] on function result.
Installation:
1. Install module
2. Enable filter "Function filter" on text format form.
Usage:
1. Implements hook_filter_functions():
function mymodule_filter_functions() {
return [
'current_date' => [
'function' => 'mymodule_current_date',
'cache' => FALSE,
],
];
}
2. Write mymodule_current_date() function:
function mymodule_current_date($format = 'r') {
return date($format);
}
3. Add in text token [function:current_date:d.m.Y] or [function:current_date].
Ask your assistant about Function Filter
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.0.0 | Stable | 8–10 | Jan 26, 2023 |