You are here

public function MentionsFilter::shouldApplyFilter in Open Social 8.3

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

Checks if a textFormat filter should be applied.

Return value

bool TRUE if filter should applied, otherwise FALSE.

1 call to MentionsFilter::shouldApplyFilter()
MentionsFilter::process in modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php
Performs the filter processing.

File

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

Class

MentionsFilter
Class FilterMentions.

Namespace

Drupal\mentions\Plugin\Filter

Code

public function shouldApplyFilter() {
  if ($this
    ->checkMentionTypes()) {
    return TRUE;
  }
  elseif ($this->textFormat && ($format = FilterFormat::load($this->textFormat))) {
    $filters = $format
      ->get('filters');
    if (!empty($filters['filter_mentions']['status'])) {
      $this->settings = $filters['filter_mentions']['settings'];
      return $this
        ->checkMentionTypes();
    }
  }
  return FALSE;
}