You are here

function oembedcore_get_provider in oEmbed 6.0

Returns the provider for a url.

Parameters

string $url: Teh url to get the provider for.

Return value

mixed A valid callback or FALSE

2 calls to oembedcore_get_provider()
oembedcore_oembed_data in ./oembedcore.module
Fetch data for an embeddable URL.
_oembedprovider_handle_request in ./oembedprovider.inc
Callback handler for oembed requests.

File

./oembedcore.module, line 138
Core functionality for oEmbed

Code

function oembedcore_get_provider($url, &$matches) {
  $host = _oembedcore_get_host($url);
  if ($host) {
    $providers = oembedcore_providers($host);
    foreach ($providers as $regex => $info) {
      if (preg_match($regex, $url, $matches)) {
        return $info;
      }
    }
  }
  return FALSE;
}