Skip to content

Instantly share code, notes, and snippets.

@james-lukensow
Created January 17, 2014 18:46
Show Gist options
  • Save james-lukensow/8479135 to your computer and use it in GitHub Desktop.
Save james-lukensow/8479135 to your computer and use it in GitHub Desktop.
/**
* Implements hook_install().
*/
function tsjf_update_7118() {
// Populates 'Vocabulary name' vocabulary with taxonomy terms.
$vocabulary = taxonomy_vocabulary_machine_name_load('tsjf_filter');
$terms = array();
$terms[] = t('Term 1');
$terms[] = t('Term 2');
$terms[] = t('Term 3');
foreach($terms as $name) {
$term = new stdClass();
$term->vid = $vocabulary->vid;
$term->name = $name;
taxonomy_term_save($term);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment