function acquia_lift_form_personalize_agent_option_sets_form_alter in Acquia Lift Connector 7.2
Same name and namespace in other branches
- 7 acquia_lift.module \acquia_lift_form_personalize_agent_option_sets_form_alter()
Implements hook_form_FORM_ID_alter().
Alters the option sets form so that it can't be used for explicit targeting on a Lift Target agent.
File
- ./
acquia_lift.module, line 2596 - acquia_lift.module Provides Acquia Lift-specific personalization functionality.
Code
function acquia_lift_form_personalize_agent_option_sets_form_alter(&$form, &$form_state) {
if (!acquia_lift_is_targeting_agent($form['#agent'])) {
return;
}
foreach ($form['variations']['primary']['option_sets'] as $name => $elements) {
if (isset($elements['options'])) {
unset($form['variations']['primary']['option_sets'][$name]['options']);
}
}
}