You are here

function fontyourface_save_tag in @font-your-face 6.2

Same name and namespace in other branches
  1. 7.2 fontyourface.module \fontyourface_save_tag()
  2. 7 fontyourface.module \fontyourface_save_tag()

Adds tag if it doesn't already exist.

1 call to fontyourface_save_tag()
fontyourface_save_font in ./fontyourface.module
Adds or updates font, depending on whether it already exists.

File

./fontyourface.module, line 994

Code

function fontyourface_save_tag(&$tag) {
  $exists = db_fetch_object(db_query("SELECT tid FROM {fontyourface_tag} WHERE name = '%s'", $tag->name));
  if ($exists) {
    $tag->tid = $exists->tid;
  }
  else {
    drupal_write_record('fontyourface_tag', $tag);
  }

  // else
}