function field_views_data

Implements hook_views_data().

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

File

modules/field.views.inc, line 16

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);
        }
        drupal_alter('field_views_data', $result, $field, $module);
        if (is_array($result)) {
            $data = drupal_array_merge_deep($result, $data);
        }
    }
    return $data;
}