1 field.views.inc field_views_data()

Implements hook_views_data().

Field modules can implement hook_field_views_data() to override the default behavior for adding fields.

File

core/modules/field/views/field.views.inc, line 15
Provide Views data and handlers for field.module.

Code

function field_views_data() {
  $data = array();
  foreach (field_info_fields() as $field) {
    if ($field['storage']['type'] != 'field_sql_storage') {
      continue;
    }

    $module = $field['module'];
    $result = (array) module_invoke($module, 'field_views_data', $field);

    if (empty($result)) {
      $result = field_views_field_default_views_data($field);
    }
    backdrop_alter('field_views_data', $result, $field, $module);

    if (is_array($result)) {
      $data = backdrop_array_merge_deep($result, $data);
    }
  }

  return $data;
}