function oembed_pre_render_thumbnail in oEmbed 7.0
Same name and namespace in other branches
- 7 oembed.module \oembed_pre_render_thumbnail()
Change oEmbed request into a thumbnail.
This is here for Media module WYSIWYG support. When a video or image is added to a text area, this step makes sure the WYSIWYG receives an image to stand in for the real media. It must be an actual img element.
1 call to oembed_pre_render_thumbnail()
- oembed_pre_render_wysiwyg in ./
oembed.module - Converts oEmbed response to a plain image.
1 string reference to 'oembed_pre_render_thumbnail'
- oembed_element_info in ./
oembed.module - Implements hook_element_info().
File
- ./
oembed.module, line 378
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;
}