You are here

function oembed_field_formatter_view in oEmbed 7

Same name and namespace in other branches
  1. 7.0 oembed.module \oembed_field_formatter_view()

Implements hook_field_formatter_view().

File

./oembed.field.inc, line 65
Field module functionality for the oEmbed module.

Code

function oembed_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  foreach ($items as $delta => $item) {
    $url = url($item['url'], $item + array(
      'external' => TRUE,
    ));
    $parameters = $display['settings'];
    $element[$delta] = oembed_render_element('oembed', $url, $parameters);
  }
  return $element;
}