You are here

function title_field_views_data_alter in Title 7

Implements hook_field_views_data_alter().

File

views/title.views.inc, line 11
Provides support for the Views module.

Code

function title_field_views_data_alter(&$result, $field, $module) {

  // Replace field default handler (views_handler_field_field).
  foreach (entity_get_info() as $entity_type => $entity_info) {
    $entity_info += array(
      'field replacement' => array(),
    );
    foreach ($entity_info['field replacement'] as $replacement) {
      if (isset($replacement['field']['field_name'])) {
        $field = field_info_field($replacement['field']['field_name']);
        if (!empty($field)) {
          $table = _field_sql_storage_tablename($field);
          if (isset($result[$table][$field['field_name']])) {
            $result[$table][$field['field_name']]['field']['handler'] = 'views_handler_title_field';
          }
        }
      }
    }
  }
}