Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By lauriii on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.8.x
Introduced in version:
8.8.0
Issue links:
Description:
Formatting guidelines markup now only contains necessary classes and attributes to attach JavaScript. All visual classes (filter-wrapper
, filter-guidelines
, filter-list
and filter-help
has been removed, as well as all of the CSS (filter.admin.css).
Note: This doesn't affect themes extending Stable or Classy.
These classes can be added back with the following code in your theme:
/**
* Implements hook_element_info_alter().
*/
function hook_element_info_alter(array &$info) {
if (array_key_exists('text_format', $info)) {
$info['text_format']['#process'][] = 'themename_process_text_format';
}
}
/**
* #process callback, for adding classes to filter components.
*
* @param array $element
* Render array for the text_format element.
*
* @return array
* Text_format element with the filter classes added.
*/
function themename_process_text_format(array $element) {
$element['format']['#attributes']['class'][] = 'filter-wrapper';
$element['format']['guidelines']['#attributes']['class'][] = 'filter-guidelines';
$element['format']['format']['#attributes']['class'][] = 'filter-list';
$element['format']['help']['#attributes']['class'][] = 'filter-help';
return $element;
}
Impacts:
Module developers
Themers