You are here

function panopoly_wysiwyg_update_7103 in Panopoly WYSIWYG 7

Remove the 'Convert line breaks into HTML' filter from the WYSIWYG format.

File

./panopoly_wysiwyg.install, line 44
Install hooks for Panopoly WYSIWYG.

Code

function panopoly_wysiwyg_update_7103() {

  // Because of the way Drupal handles filter_format_load() we need to use the method
  // outlined here: https://www.drupal.org/node/1304930
  $format = filter_format_load('panopoly_wysiwyg_text');
  if (empty($format->filters)) {
    $filters = filter_list_format($format->format);
    $format->filters = array();
    foreach ($filters as $name => $filter) {
      foreach ($filter as $k => $v) {
        $format->filters[$name][$k] = $v;
      }
    }
  }

  // Disable the 'filter_autop' filter.
  $format->filters['filter_autop']['status'] = 0;
  filter_format_save($format);
}