You are here

function instagram_feeds_taxonomy_term_presave in Instagram Feeds 7

Implements hook_taxonomy_term_presave().

File

./instagram_feeds.module, line 110

Code

function instagram_feeds_taxonomy_term_presave($term) {
  if (INSTAGRAM_FEEDS_USERS_VOCABULARY_NAME == $term->vocabulary_machine_name && (!isset($term->field_instf_uid[LANGUAGE_NONE]) || !count($term->field_instf_uid[LANGUAGE_NONE])) && ($user = instagram_feeds_get_instagram_user($term->name))) {
    $term->field_instf_uid[LANGUAGE_NONE][0]['value'] = $user->id;
  }
}