1 field.views.inc field_views_data_alter(&$data)

Implements hook_views_data_alter().

Field modules can implement hook_field_views_data_views_data_alter() to alter the views data on a per field basis. This is weirdly named so as not to conflict with the backdrop_alter('field_views_data') in field_views_data.

File

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

Code

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

    $function = $field['module'] . '_field_views_data_views_data_alter';
    if (function_exists($function)) {
      $function($data, $field);
    }
  }
}