omlex.inc in oEmbed 7
File
modules/oembedprovider_embed/plugins/providers/omlex.incView source
<?php
$plugin = array(
'title' => 'Omlex',
'callback' => 'oembedprovider_embed_omlex_callback',
'scheme' => '*',
);
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;
}
Functions
Name | Description |
---|---|
oembedprovider_embed_omlex_callback |