Disable the WYSIWYG-Editor in summary fields

Public

</> CopyGet raw version
php
  1. /**
  2.  * Implements hook_field_widget_WIDGET_TYPE_form_alter().
  3.  */
  4. function MYMODULE_field_widget_text_textarea_with_summary_form_alter(&$element, &$form_state, $context) {
  5. // Disable the WYSIWYG-Editor in summary fields
  6. if (isset($element['summary']) && !isset($element['summary']['#wysiwyg'])) {
  7. $element['summary']['#wysiwyg'] = FALSE;
  8. }
  9. }