You are here

function rules_action_taxonomy_term_assign_to_content in Rules 6

Action: Assign or remove a term to content.

Related topics

File

rules/modules/taxonomy.rules.inc, line 192
Rules integration for the taxonomy module.

Code

function rules_action_taxonomy_term_assign_to_content($node, $taxonomy_term, $settings) {
  if (!isset($node->taxonomy[$taxonomy_term->tid])) {
    $node->taxonomy[$taxonomy_term->tid] = $taxonomy_term;
    return array(
      'node' => $node,
    );
  }
}