You are here

function title_field_extra_fields_alter in Title 7

Implements hook_field_extra_fields_alter().

File

./title.module, line 721

Code

function title_field_extra_fields_alter(&$info) {
  $entity_info = entity_get_info();
  foreach ($info as $entity_type => $bundles) {
    foreach ($bundles as $bundle_name => $bundle) {
      if (!empty($entity_info[$entity_type]['field replacement'])) {
        foreach ($entity_info[$entity_type]['field replacement'] as $field_name => $field_replacement_info) {
          if (title_field_replacement_enabled($entity_type, $bundle_name, $field_name)) {

            // Remove the replaced legacy field.
            unset($info[$entity_type][$bundle_name]['form'][$field_name], $info[$entity_type][$bundle_name]['display'][$field_name]);
          }
        }
      }
    }
  }
}