function oembedprovider_embed_omlex_callback in oEmbed 7
Same name and namespace in other branches
- 7.0 oembedprovider_embed/plugins/providers/omlex.inc \oembedprovider_embed_omlex_callback()
1 string reference to 'oembedprovider_embed_omlex_callback'
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;
}