function OEmbed::createSourceField

Same name in other branches
  1. 8.9.x core/modules/media/src/Plugin/media/Source/OEmbed.php \Drupal\media\Plugin\media\Source\OEmbed::createSourceField()
  2. 10 core/modules/media/src/Plugin/media/Source/OEmbed.php \Drupal\media\Plugin\media\Source\OEmbed::createSourceField()
  3. 11.x core/modules/media/src/Plugin/media/Source/OEmbed.php \Drupal\media\Plugin\media\Source\OEmbed::createSourceField()

Overrides MediaSourceBase::createSourceField

File

core/modules/media/src/Plugin/media/Source/OEmbed.php, line 550

Class

OEmbed
Provides a media source plugin for oEmbed resources.

Namespace

Drupal\media\Plugin\media\Source

Code

public function createSourceField(MediaTypeInterface $type) {
    $plugin_definition = $this->getPluginDefinition();
    $label = (string) $this->t('@type URL', [
        '@type' => $plugin_definition['label'],
    ]);
    return parent::createSourceField($type)->set('label', $label);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.