Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Function Filter

No security coverage Under active development 1 sites

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

Drupal 8–10 · not 11

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

Tracked releases
1
Tracked since
Jan 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.0 Stable 8–10 Jan 26, 2023