You are here

function taxonomy_manager_merge_get_main_term in Taxonomy Manager 5

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.module \taxonomy_manager_merge_get_main_term()
  2. 6 taxonomy_manager.module \taxonomy_manager_merge_get_main_term()

helper function for getting out the main term of former merged term (which no long exists)

Parameters

$tid of which the main term has to be evaluated:

Return value

term id of main term, if exists, else 0

1 call to taxonomy_manager_merge_get_main_term()
taxonomy_manager_term_page in ./taxonomy_manager.module
menu callback

File

./taxonomy_manager.module, line 1358
Taxonomy Manager

Code

function taxonomy_manager_merge_get_main_term($tid) {
  $merged_terms = array();
  $cache = cache_get('taxonomy_manager_merge', 'cache');
  if (!$cache) {
    taxonomy_manager_merge_history_update_cache();
  }
  $merged_terms = unserialize($cache->data);
  return $merged_terms[$tid];
}