Returns the collection of filter pugin instances or an individual plugin instance.
string $instance_id: (optional) The ID of a filter plugin instance to return.
\Drupal\filter\FilterBag|\Drupal\filter\Plugin\FilterInterface Either the filter bag or a specific filter plugin instance.
Overrides FilterFormatInterface::filters
public function filters($instance_id = NULL) {
if (!isset($this->filterBag)) {
$this->filterBag = new FilterBag(\Drupal::service('plugin.manager.filter'), $this->filters);
}
if (isset($instance_id)) {
return $this->filterBag
->get($instance_id);
}
return $this->filterBag;
}