function LinkWidget::supportsExternalLinks

Same name in other branches
  1. 9 core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php \Drupal\link\Plugin\Field\FieldWidget\LinkWidget::supportsExternalLinks()
  2. 8.9.x core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php \Drupal\link\Plugin\Field\FieldWidget\LinkWidget::supportsExternalLinks()
  3. 11.x core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php \Drupal\link\Plugin\Field\FieldWidget\LinkWidget::supportsExternalLinks()

Indicates enabled support for link to external URLs.

Return value

bool Returns TRUE if the LinkItem field is configured to support links to external URLs, otherwise FALSE.

1 call to LinkWidget::supportsExternalLinks()
LinkWidget::formElement in core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
Returns the form for a single field widget.

File

core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php, line 369

Class

LinkWidget
Plugin implementation of the 'link' widget.

Namespace

Drupal\link\Plugin\Field\FieldWidget

Code

protected function supportsExternalLinks() {
    $link_type = $this->getFieldSetting('link_type');
    return (bool) ($link_type & LinkItemInterface::LINK_EXTERNAL);
}

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