You are here

function conditional_fields_is_triggered in Conditional Fields 5

Same name and namespace in other branches
  1. 6.2 conditional_fields.module \conditional_fields_is_triggered()
  2. 6 conditional_fields.module \conditional_fields_is_triggered()

Returns true if the field was triggered $selected_values The values of the controlling field selected by the user when creating the node $trigger_values An array containing the information we need to select the trigger values

2 calls to conditional_fields_is_triggered()
conditional_fields_nodeapi in ./conditional_fields.module
Implementation of hook_nodeapi()
conditional_fields_node_editing_form_validate in ./conditional_fields.module
Validation for node editing form.

File

./conditional_fields.module, line 637

Code

function conditional_fields_is_triggered($selected_values, $trigger_values) {
  foreach ((array) $selected_values as $values) {
    foreach ((array) $values as $value) {
      if ($value && in_array($value, $trigger_values)) {
        return TRUE;
      }
    }
  }
  return FALSE;
}