function FilterID::getSourceFilterType

Same name and namespace in other branches
  1. 10 core/modules/filter/src/Plugin/migrate/process/FilterID.php \Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType()
  2. 9 core/modules/filter/src/Plugin/migrate/process/FilterID.php \Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType()
  3. 8.9.x core/modules/filter/src/Plugin/migrate/process/FilterID.php \Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType()
  4. main core/modules/filter/src/Plugin/migrate/process/FilterID.php \Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType()

Gets the Drupal 8 filter type for a Drupal 7 filter.

Parameters

string $filter_id: A Drupal 7 filter ID.

Return value

int One of:

See also

\Drupal\filter\Plugin\FilterInterface::getType()

1 call to FilterID::getSourceFilterType()
FilterID::transform in core/modules/filter/src/Plugin/migrate/process/FilterID.php
Performs the associated process.

File

core/modules/filter/src/Plugin/migrate/process/FilterID.php, line 119

Class

FilterID
Determines the filter ID.

Namespace

Drupal\filter\Plugin\migrate\process

Code

protected static function getSourceFilterType($filter_id) {
  // Drupal 7 core filters.
  // - https://git.drupalcode.org/project/drupal/blob/7.69/modules/filter/filter.module#L1229
  // - https://git.drupalcode.org/project/drupal/blob/7.69/modules/php/php.module#L139
  return match ($filter_id) {  'filter_html' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'filter_url' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'filter_autop' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'filter_htmlcorrector' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_html_escape' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'php_code' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'abbrfilter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'ace_editor' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'adsense' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'api_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'api_tokens' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_autofloat' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'bbcode' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'biblio_filter_reference', 'biblio_filter_inline_reference' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'caption' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'caption_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_cincopa' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'ckeditor_blocks' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'ckeditor_filter' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'ckeditor_link_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'ckeditor_swf_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'codefilter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'collapse_text_filter' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'columns_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'commonmark' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'filter_hashtags' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'deepzoom' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'editor_align', 'editor_caption' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'elf' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'filter_emogrifier' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'emptyparagraphkiller' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'entity_embed' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_align' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'ext_link_page' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_html_image_secure' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'filter_transliteration' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'flickr_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'float_filter' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'filter_footnotes' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'forena_report' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_g2' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'geo_filter_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_google_analytics_counter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_google_analytics_referrer' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'gotwo_link' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'h5p_content' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'highlight_js' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'htmLawed' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'htmlpurifier_basic', 'htmlpurifier_advanced' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'htmltidy' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'icon_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'iframe' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'image_resize_filter' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'insert_view' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'intlinks title', 'intlinks hide bad' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'accordion', 'dialog', 'tabs' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'language_sections' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'lazy_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'lazyloader_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_link_node' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'linktitle' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_markdown' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'media_filter', 'media_filter_paragraph_fix' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_mentions' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'menu_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'mobile_codes' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'multicolumn' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'multilink_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'mytube' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'node_embed' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'node_field_embed' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'external_links' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'noreferrer' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'oembed', 'oembed_legacy' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'office_html_strip' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'office_html_convert' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'openlayers' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'opengraph_filter' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'pathologic' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'popup_tags' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'prettify' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'rel_to_abs' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'rollover_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'sanitizable' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'smart_paging_filter', 'smart_paging_filter_autop' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'spamspan' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'mee_scald_widgets' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'script_filter' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'shortcode' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'shortcode_text_corrector' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'smiley' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'filter_svg_embed' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'spoiler' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_toc' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_tables' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'target_filter_url' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'textile' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    'theme_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'filter_tokens' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'transliteration' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'typogrify' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'uuid_link_filter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'wysiwyg', 'wysiwyg_template_cleanup' => FilterInterface::TYPE_HTML_RESTRICTOR,
    'word_link' => FilterInterface::TYPE_TRANSFORM_REVERSIBLE,
    'wordfilter' => FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
    'xbbcode' => FilterInterface::TYPE_MARKUP_LANGUAGE,
    default => NULL,
  
  };
}

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