You are here

function title_field_replacement_get_label_field in Title 7

Returns the field instance replacing the given entity type's label.

Parameters

$entity_type: The name of the entity type.

$bundle: The name of the bundle the instance is attached to.

Return value

The field instance replacing the label or FALSE if none available.

2 calls to title_field_replacement_get_label_field()
title_field_replacement_hide_label in ./title.module
Hides the label from the given variables.
title_taxonomy_allowed_values in ./title.module
Return taxonomy term values for taxonomy reference fields.

File

./title.module, line 886

Code

function title_field_replacement_get_label_field($entity_type, $bundle) {
  $instance = FALSE;
  $info = entity_get_info($entity_type);
  if (!empty($info['field replacement'])) {
    $fr_info = $info['field replacement'];
    $legacy_field = $info['entity keys']['label'];
    if (!empty($fr_info[$legacy_field]['field'])) {
      $instance = field_info_instance($entity_type, $fr_info[$legacy_field]['field']['field_name'], $bundle);
    }
  }
  return $instance;
}