You are here

public static function EntityReferenceLayoutWidget::processLayoutOptions in Entity Reference with Layout 8

Add theme wrappers to layout selection radios.

Theme function injects layout icons into radio buttons.

File

src/Plugin/Field/FieldWidget/EntityReferenceLayoutWidget.php, line 945

Class

EntityReferenceLayoutWidget
Entity Reference with Layout field widget.

Namespace

Drupal\entity_reference_layout\Plugin\Field\FieldWidget

Code

public static function processLayoutOptions($element) {
  foreach (Element::children($element) as $radio_item) {
    $element[$radio_item]['#theme_wrappers'][] = 'entity_reference_layout_radio';
  }
  return $element;
}