You are here

function oembedembedly_provider_get_child in oEmbed 8

Same name and namespace in other branches
  1. 7 modules/oembedembedly/plugins/providers/embedly.inc \oembedembedly_provider_get_child()
  2. 7.0 oembedembedly/plugins/providers/embedly.inc \oembedembedly_provider_get_child()
1 string reference to 'oembedembedly_provider_get_child'
embedly.inc in modules/oembedembedly/plugins/providers/embedly.inc

File

modules/oembedembedly/plugins/providers/embedly.inc, line 26

Code

function oembedembedly_provider_get_child($plugin, $parent, $child) {
  $json = oembedembedly_providers();
  $plugin['name'] = $parent . ':' . $child;
  $plugin['title'] = $json[$child]->displayname;
  $plugin['description'] = $json[$child]->about;
  $plugin['scheme'] = $json[$child]->regex;

  // Force the plugin to be processed again because it will persist in the static cache
  // of ctools_get_plugins(). Therefore, strip out the features of the child plugin
  // that make it look like the parent.
  unset($plugin['scheme callback']);
  unset($plugin['scheme map']);
  unset($plugin['weight']);
  $info = ctools_plugin_get_info('oembed', 'providers');
  $function = ctools_plugin_get_function($info, 'process');
  $function($plugin, $info);
  return $plugin;
}