You are here

public function SocialEmbedUrlFilter::process in Open Social 8.9

Same name and namespace in other branches
  1. 8 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  2. 8.2 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  3. 8.3 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  4. 8.4 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  5. 8.5 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  6. 8.6 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  7. 8.7 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  8. 8.8 modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  9. 10.3.x modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  10. 10.0.x modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  11. 10.1.x modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::process()
  12. 10.2.x modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php \Drupal\social_embed\Plugin\Filter\SocialEmbedUrlFilter::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 ConvertUrlToEmbedFilter::process

See also

\Drupal\filter\FilterProcessResult

File

modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlFilter.php, line 34

Class

SocialEmbedUrlFilter
Provides a filter to display embedded entities based on data attributes.

Namespace

Drupal\social_embed\Plugin\Filter

Code

public function process($text, $langcode) {

  // Check for whitelisted URL.
  if ($this
    ->whiteList($text)) {
    return parent::process($text, $langcode);
  }

  // Not whitelisted is return the string as is.
  return new FilterProcessResult($text);
}