function _termcase_update_all_terms in Termcase 6
Same name and namespace in other branches
- 7 termcase.module \_termcase_update_all_terms()
Helper function to loop through all terms in the specified vocabulary and apply the case formatting to each of them
1 call to _termcase_update_all_terms()
- termcase_taxonomy in ./
termcase.module - Implementation of hook_taxonomy().
File
- ./
termcase.module, line 226 - The Termcase module gives you the option to specify specific case-formatting on terms.
Code
function _termcase_update_all_terms($vid) {
$tree = taxonomy_get_tree($vid);
$case = _termcase_vocabulary_termcase($vid);
$synonyms = _termcase_vocabulary_termcase_synonyms($vid);
foreach ($tree as $term) {
_termcase_update_term_name($term->tid, _termcase_convert_string_to_case($term->name, $case));
if ($synonyms) {
_termcase_update_term_synonyms($term->tid, $case);
}
}
drupal_set_message(t('@terms been updated', array(
'@terms' => format_plural(sizeof($tree), '1 term has', '@count terms have'),
)));
}