function Editor::textFormatHasTransformationFilters

Returns whether the text format has transformation filters.

Parameters

int $format_id: A text format ID.

Return value

bool

1 call to Editor::textFormatHasTransformationFilters()
Editor::getMetadata in core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
Generates metadata that is needed specifically for this editor.

File

core/modules/editor/src/Plugin/InPlaceEditor/Editor.php, line 61

Class

Editor
Defines the formatted text in-place editor.

Namespace

Drupal\editor\Plugin\InPlaceEditor

Code

protected function textFormatHasTransformationFilters($format_id) {
  $format = FilterFormat::load($format_id);
  return (bool) count(array_intersect([
    FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
  ], $format->getFiltertypes()));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.