function title_field_replacement_enabled in Title 7
Check whether field replacement is enabled for the given field.
Parameters
$entity_type: The type of $entity.
$bundle: The bundle the legacy field belongs to.
$legacy_field: The name of the legacy field to be replaced.
Return value
TRUE if field replacement is enabled for the given field, FALSE otherwise.
7 calls to title_field_replacement_enabled()
- TitleAdminSettingsTestCase::doTestAutomatedFieldAttachment in tests/
TitleAdminSettingsTestCase.test - Check that the fields are replaced or skipped depending on the given value.
- TitleFieldReplacementTestCase::testFieldReplacementUI in tests/
TitleFieldReplacementTestCase.test - Test field replacement UI.
- title_entity_label in ./
title.module - Implements callback_entity_info_label().
- title_entity_sync in ./
title.module - Synchronize replaced fields with the regular field values.
- title_field_attach_form in ./
title.module - Implements hook_field_attach_form().
File
- ./
title.module, line 284
Code
function title_field_replacement_enabled($entity_type, $bundle, $legacy_field) {
$info = title_field_replacement_info($entity_type, $legacy_field);
if (!empty($info['field']['field_name'])) {
$instance = field_info_instance($entity_type, $info['field']['field_name'], $bundle);
}
return !empty($instance);
}