You are here

function node_field_taxonomy_settings in Node Field 7.2

Settings for taxonomy field.

1 string reference to 'node_field_taxonomy_settings'
node_field_types_info in includes/node_field.field.inc
Node field types info.

File

includes/node_field.field.inc, line 525
Field types, settings, widget and formatters.

Code

function node_field_taxonomy_settings($node_field) {
  $vocs_options = [];
  $vocs = taxonomy_vocabulary_get_names();
  foreach ($vocs as $voc) {
    $vocs_options[$voc->vid] = $voc->name;
  }
  $form['vocs'] = [
    '#type' => 'select',
    '#title' => t('Vocabulary'),
    '#options' => $vocs_options,
    '#empty_option' => t('- Select -'),
    '#default_value' => !empty($node_field['settings']['vocs']) ? $node_field['settings']['vocs'] : NULL,
  ];
  return $form;
}