You are here

public function FlickrFilter::process in Flickr 8

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/flickr_filter/src/Plugin/Filter/FlickrFilter.php, line 95

Class

FlickrFilter
Provides a filter to insert Flickr photo.

Namespace

Drupal\flickr_filter\Plugin\Filter

Code

public function process($text, $langcode) {
  $text = preg_replace_callback('/\\[flickr-photo:(.+?)\\]/', 'self::callbackPhoto', $text);
  $text = preg_replace_callback('/\\[flickr-photoset:(.+?)\\]/', 'self::callbackPhotosets', $text);

  // TODO Implement the rest of the options.
  // @codingStandardsIgnoreStart
  // $text = preg_replace_callback('/\[flickr-group:(.+?)\]/', 'flickr_filter_callback_group', $text);
  // $text = preg_replace_callback('/\[flickr-gallery:(.+?)\]/', 'flickr_filter_callback_gallery', $text);
  // $text = preg_replace_callback('/\[flickr-user:(.+?)\]/', 'flickr_filter_callback_album', $text);
  // $text = preg_replace_callback('/\[flickr-favorites:(.+?)\]/', 'flickr_filter_callback_favorites', $text);.
  // @codingStandardsIgnoreEnd
  return new FilterProcessResult($text);
}