hook_editor_xss_filter_alter(&$editor_xss_filter_class, FilterFormatInterface $format, FilterFormatInterface $original_format = NULL)
Modifies the text editor XSS filter that will used for the given text format.
Is only called when an EditorXssFilter will effectively be used; this hook does not allow one to alter that decision.
string &$editor_xss_filter_class: The text editor XSS filter class that will be used.
\Drupal\filter\FilterFormatInterface $format: The text format configuration entity. Provides context based upon which one may want to adjust the filtering.
\Drupal\filter\FilterFormatInterface $original_format|null: (optional) The original text format configuration entity (when switching text formats/editors). Also provides context based upon which one may want to adjust the filtering.
\Drupal\editor\EditorXssFilterInterface
function hook_editor_xss_filter_alter(&$editor_xss_filter_class, FilterFormatInterface $format, FilterFormatInterface $original_format = NULL) { $filters = $format->filters()->getAll(); if (isset($filters['filter_wysiwyg']) && $filters['filter_wysiwyg']->status) { $editor_xss_filter_class = '\Drupal\filter_wysiwyg\EditorXssFilter\WysiwygFilter'; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!editor!editor.api.php/function/hook_editor_xss_filter_alter/8.1.x