Программно создать термин Term Taxonomy Drupal (с Domain Access)

$vocabulary = taxonomy_vocabulary_machine_name_load($data_term['vocabulary_machine_name']);
$term = (object)array(
  'vid' => $vocabulary->vid,
  'name' => $data_term['title'],
  'parent' => $data_term['parent'],
);

// Зависимость от домена

$term->domain_update_subterm = 0;
$term->domain_update_subnodes = 0;
$term->domain_load_from_parent = 0;
$term->domain_site = 0;

$term->domains['1'] = 1;
$term->domains['2'] = 0;
$term->domains['3'] = 0;

$term->domain_source = "1";
    
            
taxonomy_term_save($term);
domain_taxonomy_save_term($term); // WARNING :)