You are here

function simplenews_get_term_values in Simplenews 7

Get simplenews category term values from a node object.

Related topics

3 calls to simplenews_get_term_values()
simplenews_newsletter_defaults in ./simplenews.module
Return default newsletter.
simplenews_node_update in ./simplenews.module
Implements hook_node_update().
simplenews_node_validate in ./simplenews.module
Implements hook_node_validate().

File

./simplenews.module, line 377
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_get_term_values($node) {
  $category_field = simplenews_get_category_field($node->type);
  $taxonomy = $node->{$category_field['field_name']};
  if (isset($taxonomy[$node->language])) {
    return $taxonomy[$node->language];
  }
  $term = current($taxonomy);
  return $term ? $term : FALSE;
}