You are here

function oembedprovider_embed_omlex_callback in oEmbed 7

Same name and namespace in other branches
  1. 7.0 oembedprovider_embed/plugins/providers/omlex.inc \oembedprovider_embed_omlex_callback()
1 string reference to 'oembedprovider_embed_omlex_callback'
omlex.inc in modules/oembedprovider_embed/plugins/providers/omlex.inc

File

modules/oembedprovider_embed/plugins/providers/omlex.inc, line 9

Code

function oembedprovider_embed_omlex_callback($plugin, $url, $matches, $parameters) {
  $embed = FALSE;
  $ombed = new Omlex\OEmbed($url);

  // oEmbed response is a protected property of the object, so casting to an array is
  // the only way. See http://www.php.net/manual/en/language.types.array.php#language.types.array.casting
  $object = (array) $ombed
    ->getObject($parameters);
  if ($object) {
    $embed = (array) $object["\0*\0object"];
  }
  return $embed;
}