You are here

function oembed_field_formatter_view in oEmbed 7.0

Same name and namespace in other branches
  1. 7 oembed.field.inc \oembed_field_formatter_view()

Implements hook_field_formatter_view().

File

./oembed.module, line 940

Code

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