You are here

function pca_webform_webform_options_alter in Loqate 8

Same name and namespace in other branches
  1. 2.x modules/pca_webform/pca_webform.module \pca_webform_webform_options_alter()

Implements hook_webform_options_alter().

File

modules/pca_webform/pca_webform.module, line 11
Contains pca_webform.module.

Code

function pca_webform_webform_options_alter(array &$options, array &$element) {

  // If element options doesn't exist or if the options is an array then
  // exit early.
  if (!isset($element['#options']) || is_array($element['#options'])) {
    return;
  }

  // Where a system set of options is used, apply a data attribute to use in JS.
  $element['#attributes']['data-option-type'] = $element['#options'];
}