function taxonomy_csv_vocabulary_create in Taxonomy CSV import/export 7.5
Same name and namespace in other branches
- 6.5 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
- 6.2 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
- 6.3 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
- 6.4 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
- 7.4 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
Creates vocabulary by its name and returns vocabulary object.
Parameters
$name: (Optional) Name of vocabulary to create.
Return value
Created vocabulary object.
1 call to taxonomy_csv_vocabulary_create()
- _taxonomy_csv_import_vocabulary_prepare in import/
taxonomy_csv.import.api.inc - Prepare a vocabulary for import.
File
- ./
taxonomy_csv.vocabulary.api.inc, line 17 - Prepare and manage vocabularies.
Code
function taxonomy_csv_vocabulary_create($name = '') {
$name = _taxonomy_csv_vocabulary_name_create($name);
// Create an empty vocabulary with default Drupal 7 fields.
// Hierarchy is updated later.
$vocabulary = (object) array(
'name' => $name,
'machine_name' => taxonomy_csv_vocabulary_machine_name_create($name),
'description' => t('Vocabulary created automatically by Taxonomy csv import/export module'),
'hierarchy' => 2,
'module' => 'taxonomy',
'weight' => 0,
);
$result = taxonomy_vocabulary_save($vocabulary);
return $vocabulary;
}