You are here

function oembed_pre_render_thumbnail in oEmbed 7

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

Change oEmbed request into a thumbnail.

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

File

./oembed.module, line 404
Core functionality for oEmbed

Code

function oembed_pre_render_thumbnail($element) {

  // Only act when the oEmbed response is true.
  if (!empty($element['#printed'])) {
    return $element;
  }
  $embed = $element['#embed'];

  // Check if the oEmbed response provides a thumbnail image.
  if (empty($embed['thumbnail_url'])) {
    $element['#printed'] = TRUE;
    return $element;
  }
  oembed_pre_render_image_helper($element, 'thumbnail_');
  return $element;
}