function form_placeholder_process_element in Form Placeholder 7
Same name and namespace in other branches
- 8 form_placeholder.module \form_placeholder_process_element()
Element process callback.
Parameters
array $element: The render array element.
Return value
array The processed element.
2 string references to 'form_placeholder_process_element'
File
- ./
form_placeholder.module, line 88 - Use field label as placeholder for all elements in choosen form.
Code
function form_placeholder_process_element($element) {
if (isset($element['#form_placeholder'])) {
$action = $element['#form_placeholder'] == TRUE ? 'include' : 'exclude';
if ($element['#type'] == 'form') {
$element['#attributes']['class'][] = 'form-placeholder-' . $action . '-children';
}
else {
$element['#attributes']['class'][] = 'form-placeholder-' . $action;
}
}
if ($element['#type'] == 'form') {
form_placeholder_attach($element);
}
return $element;
}