You are here

public static function oEmbed::preRenderRetheme in oEmbed 8

File

src/Element/oEmbed.php, line 63

Class

oEmbed
Class oEmbed @package Drupal\oembed\Render\Element

Namespace

Drupal\oembed\Element

Code

public static function preRenderRetheme($element) {

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

  /** @var \Bangpound\oEmbed\Response\Response $embed */
  $embed = $element['#embed'];
  $element['#theme'] = 'oembed__' . $embed
    ->getType() . '__' . implode('__', explode(':', $embed
    ->getProviderName(), 2));
  return $element;
}