You are here

function oembed_pre_render_fetch in oEmbed 7.0

Same name and namespace in other branches
  1. 7 oembed.module \oembed_pre_render_fetch()

Pre render fetches the oEmbed data.

1 string reference to 'oembed_pre_render_fetch'
oembed_element_info in ./oembed.module
Implements hook_element_info().

File

./oembed.module, line 470

Code

function oembed_pre_render_fetch($element) {
  $embed = oembed_get_data($element['#url'], $element['#parameters']);

  // Prevent rendering if the response is bad.
  if (!$embed) {
    $element['#printed'] = TRUE;
    return $element;
  }
  $element['#embed'] = $embed;
  return $element;
}