You are here

function _content_profile_registration_remove_values in Content Profile 6

Recursivly removes all form values created by this element or its children.

1 call to _content_profile_registration_remove_values()
content_profile_registration_user_register_validate in modules/content_profile_registration.module
Validates the user registration form

File

modules/content_profile_registration.module, line 231
Allows exposure and processing of content_profile node fields at user registration

Code

function _content_profile_registration_remove_values($key, $element, &$form_state) {
  if ((isset($element['#input']) || !empty($element['#tree'])) && isset($form_state['values'][$key])) {
    unset($form_state['values'][$key]);
  }
  elseif (empty($element['#input']) && empty($element['#tree'])) {
    foreach (element_children($element) as $key) {
      _content_profile_registration_remove_values($key, $element[$key], $form_state);
    }
  }
}