I am creating content type programmatically. I am importing content from csv file.. Everything working fine. But I am not able to select category at the time of import like other fields.. and how to convert term name to term id ,because csv giving me term name.
1 Answer
This function will return the term object if you pass it the term name: https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/function/taxonomy_get_term_by_name/7
There is an example at the bottom of that link