function _name_get_vocabulary_id_by_code_or_number in Name Field 7
Helper function to get the vid from a machine name or number.
2 calls to _name_get_vocabulary_id_by_code_or_number()
- _name_field_get_options in includes/
name.content.inc - _name_options_validate in includes/
name.content.inc - Checks that individual values in the defined options list do not exceed the limits placed on the component.
File
- includes/
name.content.inc, line 650 - Provides additional Field functionality for the name module.
Code
function _name_get_vocabulary_id_by_code_or_number($value) {
$vid = FALSE;
if (empty($value)) {
return $vid;
}
if (intval($value) == $value && ($vocab = taxonomy_vocabulary_load($value))) {
$vid = $value;
}
elseif ($vocab = taxonomy_vocabulary_machine_name_load($value)) {
$vid = $vocab->vid;
}
return $vid;
}