function OEmbedWidget::isApplicable
Same name in other branches
- 8.9.x core/modules/media/src/Plugin/Field/FieldWidget/OEmbedWidget.php \Drupal\media\Plugin\Field\FieldWidget\OEmbedWidget::isApplicable()
- 10 core/modules/media/src/Plugin/Field/FieldWidget/OEmbedWidget.php \Drupal\media\Plugin\Field\FieldWidget\OEmbedWidget::isApplicable()
- 11.x core/modules/media/src/Plugin/Field/FieldWidget/OEmbedWidget.php \Drupal\media\Plugin\Field\FieldWidget\OEmbedWidget::isApplicable()
Overrides WidgetBase::isApplicable
File
-
core/
modules/ media/ src/ Plugin/ Field/ FieldWidget/ OEmbedWidget.php, line 55
Class
- OEmbedWidget
- Plugin implementation of the 'oembed_textfield' widget.
Namespace
Drupal\media\Plugin\Field\FieldWidgetCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
$target_bundle = $field_definition->getTargetBundle();
if (!parent::isApplicable($field_definition) || $field_definition->getTargetEntityTypeId() !== 'media' || !$target_bundle) {
return FALSE;
}
return MediaType::load($target_bundle)->getSource() instanceof OEmbedInterface;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.