You are here

function oembed_filter_oembed_process in oEmbed 7.0

Same name and namespace in other branches
  1. 7 oembed.filter.inc \oembed_filter_oembed_process()

Implements hook_filter_FILTER_process().

1 string reference to 'oembed_filter_oembed_process'
oembed_filter_info in ./oembed.filter.inc
Implements hook_filter_info().

File

./oembed.filter.inc, line 117
Input filter that enhances oEmbed enabled URLs with extra content

Code

function oembed_filter_oembed_process($text, $filter, $format, $langcode, $cache, $cache_id) {
  global $_oembed_filter_settings;
  $_oembed_filter_settings = !empty($filter->settings['options']) ? oembed_parse_attr($filter->settings['options']) : array();
  $_oembed_filter_settings['view_mode'] = $filter->settings['view_mode'];

  // Undo auto paragraph around oEmbed shortcodes.
  $text = preg_replace(OEMBED_PATTERN_EMBED_UNWRAP, '$1', $text);
  $text = preg_replace_callback(OEMBED_PATTERN_EMBED_SHORTCODE, 'oembed_preg_tag_replace', $text);
  unset($_oembed_filter_settings);
  return $text;
}