Show Active terms from vocabulary using taxonomy menu What i want: Active terms of vocabulary in main menu.

What i have done so far:


I have used taxonomy_menu module.
Created taxonomy(Category).
Added "Status" field having boolean values (0 = Inactive, 1 = Active).
Added two terms in Category(Cat1 and Cat2).
Cat1 = Active, Cat2 = Inactive.
Configured menu from "Edit vocabulary" section.


Problem: All terms of vocabulary are included in main menu. I want that only those terms whose Status = Active should be displayed in main menu.

Community, please help. Any hint would be helpful.
You can do this by using hook on taxonomy insert and update inside a custom module.

Here is a sample of code (needs refactoring/cleaning/checking but that's a start and it works for me) :

function custom_module_taxonomy_menu_insert(&amp;$item) {
  //load taxonomy to access fields
  $tax = taxonomy_term_load($item['tid']);
  //get your field display (here i called it field_status)
  $display = isset($tax-&gt;field_status['und'][0]['value'])?$tax-&gt;field_status['und'][0]['value']:'';
  //check your value
  if($display == 0) {
    //I don't want to display this element
    $item['remove'] = TRUE;
    return $item;
  }
}

function custom_module_taxonomy_menu_update(&amp;$item) {
  //IDEM without comments
  $tax = taxonomy_term_load($item['tid']);
  $display = isset($tax-&gt;field_status['und'][0]['value'])?$tax-&gt;field_status['und'][0]['value']:'';
  if($display == 0) {
    $item['remove'] = TRUE;
    return $item;
  }
}


[Edit to add some details]

The menu will not update automatically, you'll have to save/update your terms to update the menu (hook_taxonomy_menu_update). For new terms, it's going to work automatically  (hook_taxonomy_menu_insert).