Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It depends on the Taxonomy Publisher module (now part of the Taxonomy tools project), which
attaches a status field to the taxonomy terms of the vocabularies you select.
Versions
The current version supports select, checkbox/radio and autocomplete widgets for term reference fields.
How to use
download the module and place it under 'sites/all/modules/contrib' folder
with Drush use: drush dl taxonomy_tools
enable the module from the modules page: 'admin/build/modules' the Taxonomy Publisher & Taxonomy Publisher Filter module
enable taxonomy publisher on the vocabularies you wish to limit
enable/disable the terms in the above vocabularies
configure roles that show see the limited list only under admin/people/permission
Custom Form
_taxonomy_publisher_filter_custom_form($vid, $settings) function is helpful to filter your select or checkbox/radio field in custom forms.
The function will expect a vocabulary id by default and will return the filtered option list.