function themekey_taxonomy_tid2vid in ThemeKey 6.2
Same name and namespace in other branches
- 6.4 modules/themekey.taxonomy.inc \themekey_taxonomy_tid2vid()
- 6 modules/themekey.taxonomy.inc \themekey_taxonomy_tid2vid()
- 6.3 modules/themekey.taxonomy.inc \themekey_taxonomy_tid2vid()
- 7.3 modules/themekey.taxonomy.inc \themekey_taxonomy_tid2vid()
- 7 modules/themekey.taxonomy.inc \themekey_taxonomy_tid2vid()
- 7.2 modules/themekey.taxonomy.inc \themekey_taxonomy_tid2vid()
ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
src: taxonomy:tid dst: taxonomy:vid
Parameters
$tids: array of taxonomy term ids or a single term id
Return value
array of taxonomy vocabulary ids or NULL if no value could be mapped
1 string reference to 'themekey_taxonomy_tid2vid'
- themekey_taxonomy_themekey_properties in modules/
themekey.taxonomy.inc - Implements hook_themekey_properties().
File
- modules/
themekey.taxonomy.inc, line 99 - Provides some taxonomy stuff as ThemeKey properties.
Code
function themekey_taxonomy_tid2vid($tids) {
$vid = array();
// TODO use taxonomy API instead of SQL
$tids = is_array($tids) ? $tids : array(
$tids,
);
foreach ($tids as $tid) {
$vid[] = db_result(db_query('SELECT vid FROM {term_data} WHERE tid = %d', $tid));
}
return count($vid) ? $vid : NULL;
}