function template_preprocess_filter_guidelines
Same name in other branches
- 9 core/modules/filter/filter.module \template_preprocess_filter_guidelines()
- 8.9.x core/modules/filter/filter.module \template_preprocess_filter_guidelines()
- 11.x core/modules/filter/filter.module \template_preprocess_filter_guidelines()
Prepares variables for text format guideline templates.
Default template: filter-guidelines.html.twig.
Parameters
array $variables: An associative array containing:
- format: An object representing a text format.
File
-
core/
modules/ filter/ filter.module, line 365
Code
function template_preprocess_filter_guidelines(&$variables) {
$format = $variables['format'];
$variables['tips'] = [
'#theme' => 'filter_tips',
'#tips' => _filter_tips($format->id(), FALSE),
];
// Add format id for filter.js.
$variables['attributes']['data-drupal-format-id'] = $format->id();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.