diff --git a/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php b/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php index 436a4fc..5e035a8 100644 --- a/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php +++ b/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php @@ -74,6 +74,14 @@ public function viewElements(FieldItemListInterface $items) { '#href' => 'tel:' . rawurlencode(preg_replace('/\s+/', '', $item->value)), '#options' => array('external' => TRUE), ); + + if (!empty($item->_attributes)) { + $element[$delta]['#options'] += array('attributes' => array()); + $element[$delta]['#options']['attributes'] += $item->_attributes; + // Unset field item attributes since they have been included in the + // formatter output and should not be rendered in the field template. + unset($item->_attributes); + } } return $element;