function mailhandler_term_map in Mailhandler 7
Same name and namespace in other branches
- 5 mailhandler.module \mailhandler_term_map()
- 6 mailhandler.module \mailhandler_term_map()
Accept a taxonomy term name and replace with a tid. this belongs in taxonomy.module.
1 string reference to 'mailhandler_term_map'
File
- ./
mailhandler.module, line 529
Code
function mailhandler_term_map(&$term, $index = array(), $vid = FALSE) {
// provide case insensitive and trimmed map so as to maximize likelihood of successful mapping
if ($vid) {
$and = 'AND vid =' . db_escape_string($vid);
}
$term = db_result(db_query("SELECT tid FROM {term_data} WHERE LOWER('%s') LIKE LOWER(name) {$and}", trim($term)));
}