function taxonomy_field_info
taxonomy_field_info()
Implements hook_field_info().
Field settings:
-
allowed_values: a list array of one or more vocabulary trees:
- vocabulary: a vocabulary machine name.
- parent: a term ID of a term whose children are allowed. This should be '0' if all terms in a vocabulary are allowed. The allowed values do not include the parent term.
File
- modules/taxonomy/taxonomy.module, line 1445
- Enables the organization of content into categories.
Code
function taxonomy_field_info() { return array( 'taxonomy_term_reference' => array( 'label' => t('Term reference'), 'description' => t('This field stores a reference to a taxonomy term.'), 'default_widget' => 'options_select', 'default_formatter' => 'taxonomy_term_reference_link', 'settings' => array( 'allowed_values' => array( array( 'vocabulary' => '', 'parent' => '0', ), ), ), ), ); }
© 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!taxonomy!taxonomy.module/function/taxonomy_field_info/7.x