function _field_ui_field_name_exists
_field_ui_field_name_exists($value)
Render API callback: Checks if a field machine name is taken.
Parameters
$value: The machine name, not prefixed with 'field_'.
Return value
Whether or not the field machine name is taken.
File
- modules/field_ui/field_ui.admin.inc, line 722
- Administrative interface for custom field type creation.
Code
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)); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field_ui!field_ui.admin.inc/function/_field_ui_field_name_exists/7.x