You are here

function user_badges_rules_condition_has_badge in User Badges 7.3

Same name and namespace in other branches
  1. 7.4 user_badges.rules.inc \user_badges_rules_condition_has_badge()

Condition: User has badge.

1 string reference to 'user_badges_rules_condition_has_badge'
user_badges_rules_condition_info in ./user_badges.rules.inc
Implementation of hook_rules_condition_info().

File

./user_badges.rules.inc, line 166

Code

function user_badges_rules_condition_has_badge($badge_id, $user) {
  $has_badge = FALSE;
  $badges = user_badges_get_badges($user->uid);
  if (isset($badges[$badge_id])) {
    $has_badge = TRUE;
  }
  return $has_badge;
}