You are here

protected function OEmbedProcessor::getOembedProviders in Gutenberg 8.2

Get the oEmbed provider definitions.

Return value

array The oEmbed providers.

1 call to OEmbedProcessor::getOembedProviders()
OEmbedProcessor::getProviderUri in src/BlockProcessor/OEmbedProcessor.php
Get a configured provider for the oEmbed resource.

File

src/BlockProcessor/OEmbedProcessor.php, line 282

Class

OEmbedProcessor
Processes oEmbed blocks.

Namespace

Drupal\gutenberg\BlockProcessor

Code

protected function getOembedProviders() {
  if ($this->oembedProviders === NULL) {
    $this->oembedProviders = [];
    $providers_string = $this->settings['oembed']['providers'];
    $providers_line = explode("\n", $providers_string);
    foreach ($providers_line as $value) {
      $items = explode(' | ', trim($value));
      if (count($items) === 3) {
        $key = array_shift($items);
        $this->oembedProviders[$key] = $items;
      }
    }
  }
  return $this->oembedProviders;
}