You are here

function bricks_field_widget_info_alter in Bricks​ 8

Same name and namespace in other branches
  1. 2.x bricks.module \bricks_field_widget_info_alter()

Implements hook_field_widget_info_alter().

File

./bricks.module, line 117

Code

function bricks_field_widget_info_alter(array &$info) {

  // Let Bricks to re-use ANY Entity Reference -compatible widgets:
  foreach ($info as $widget_id => &$widget_info) {
    if (in_array('entity_reference', $widget_info['field_types'])) {
      $widget_info['field_types'][] = 'bricks';
    }
    if (in_array('entity_reference_revisions', $widget_info['field_types'])) {
      $widget_info['field_types'][] = 'bricks_revisioned';
    }
  }
}