You are here

function oembedprovider_embed_embedly2_callback in oEmbed 7

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

File

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

Code

function oembedprovider_embed_embedly2_callback($plugin, $url, $matches, $parameters) {
  $embed = FALSE;
  $api = new Embedly\Embedly(array(
    'key' => variable_get('oembedembedly_api_key', NULL),
  ));
  $parameters['url'] = $url;
  $objs = $api
    ->oembed($parameters);
  if ($objs) {
    $embed = (array) array_pop($objs);
  }
  return $embed;
}