Create a term in the specified vocabulary.

Parameters

int $vid: The ID of the vocabulary to add the term to.

string $name: The name of the taxonomy term.

int $parent_term: The parent term ID; defaults to 0.

Return value

object The newly created term object.

1 call to _exif_create_term()
_exif_handle_taxonomy_field in ./exif.module
Handle taxonomy field.

File

./exif.module, line 437

Code

function _exif_create_term($vid, $name, $parent_term = 0) {
    $term = new stdClass();
    $term->vid = $vid;
    $term->name = $name;
    $term->parent = array(
        $parent_term,
    );
    taxonomy_term_save($term);
    return $term;
}