You are here

function conditional_fields_is_priority_field in Conditional Fields 4.x

Same name and namespace in other branches
  1. 8 conditional_fields.module \conditional_fields_is_priority_field()

Checking if field is priority for rewrite the conditions If the field widget is datelist this function help to return correct object for this field

Parameters

array $field: The field form element.

Return value

bool Check the fields is priority and return the boolean result

1 call to conditional_fields_is_priority_field()
conditional_fields_element_after_build in ./conditional_fields.module
Processes form elements with dependencies.

File

./conditional_fields.module, line 362
Contains conditional_fields.module.

Code

function conditional_fields_is_priority_field(array $field) {
  $priority_fields = [
    'datelist',
  ];

  //For modules supports
  Drupal::moduleHandler()
    ->alter([
    'conditional_fields_priority_field',
  ], $priority_fields);
  if (isset($field['#type']) && in_array($field['#type'], $priority_fields)) {
    return TRUE;
  }
  return FALSE;
}