You are here

public function MentionsFilter::process in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  2. 8 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  3. 8.2 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  4. 8.3 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  5. 8.4 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  6. 8.6 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  7. 8.7 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  8. 8.8 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  9. 10.3.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  10. 10.0.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  11. 10.1.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()
  12. 10.2.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::process()

Performs the filter processing.

Parameters

string $text: The text string to be filtered.

string $langcode: The language code of the text to be filtered.

Return value

\Drupal\filter\FilterProcessResult The filtered text, wrapped in a FilterProcessResult object, and possibly with associated assets, cacheability metadata and placeholders.

Overrides FilterInterface::process

See also

\Drupal\filter\FilterProcessResult

File

modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php, line 240

Class

MentionsFilter
Class FilterMentions.

Namespace

Drupal\mentions\Plugin\Filter

Code

public function process($text, $langcode) {
  if ($this
    ->shouldApplyFilter()) {
    $text = $this
      ->filterMentions($text);
    return new FilterProcessResult($text);
  }
  return new FilterProcessResult($text);
}