Render API callback: Checks if a field machine name is taken.
$value: The machine name, not prefixed with 'field_'.
Whether or not the field machine name is taken.
function _field_ui_field_name_exists($value) {
// Prefix with 'field_'.
$field_name = 'field_' . $value;
// We need to check inactive fields as well, so we can't use
// field_info_fields().
return (bool) field_read_fields(array(
'field_name' => $field_name,
), array(
'include_inactive' => TRUE,
));
}