Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. OEmbed.php

function OEmbed::prepareFormDisplay

Overrides MediaSourceBase::prepareFormDisplay

File

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

Class

OEmbed
Provides a media source plugin for oEmbed resources.

Namespace

Drupal\media\Plugin\media\Source

Code

public function prepareFormDisplay(MediaTypeInterface $type, EntityFormDisplayInterface $display) {
    parent::prepareFormDisplay($type, $display);
    $source_field = $this->getSourceFieldDefinition($type)
        ->getName();
    $display->setComponent($source_field, [
        'type' => 'oembed_textfield',
        'weight' => $display->getComponent($source_field)['weight'],
    ]);
    $display->removeComponent('name');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal