function WidgetBase::isApplicable

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::isApplicable()
  2. 8.9.x core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::isApplicable()
  3. 10 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::isApplicable()

Overrides WidgetInterface::isApplicable

4 methods override WidgetBase::isApplicable()
MediaLibraryWidget::isApplicable in core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
Returns if the widget can be used for the provided field.
ModerationStateWidget::isApplicable in core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php
Returns if the widget can be used for the provided field.
OEmbedWidget::isApplicable in core/modules/media/src/Plugin/Field/FieldWidget/OEmbedWidget.php
Returns if the widget can be used for the provided field.
TestFieldWidgetMultiple::isApplicable in core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php
Test is the widget is applicable to the field definition.

File

core/lib/Drupal/Core/Field/WidgetBase.php, line 692

Class

WidgetBase
Base class for 'Field widget' plugin implementations.

Namespace

Drupal\Core\Field

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
    // By default, widgets are available for all fields.
    return TRUE;
}

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