You are here

function icon_field_field_widget_form in Icon API 7

Implements hook_field_widget_form().

File

modules/icon_field/icon_field.module, line 63
icon_field.module Provides a field for attaching an icon to a fieldable entity.

Code

function icon_field_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  $element += array(
    '#type' => 'icon_selector',
    '#default_bundle' => isset($items[$delta]['bundle']) ? $items[$delta]['bundle'] : '',
    '#default_icon' => isset($items[$delta]['icon']) ? $items[$delta]['icon'] : '',
    '#default_wrapper' => isset($items[$delta]['wrapper']) ? $items[$delta]['wrapper'] : '',
    '#default_wrapper_class' => isset($items[$delta]['wrapper_class']) ? $items[$delta]['wrapper_class'] : '',
  );
  return $element;
}