function simplify_hide_text_format_elements in Simplify 8
Same name and namespace in other branches
- 7.3 simplify.module \simplify_hide_text_format_elements()
Recurse through the provided form and hide any text_format elements.
Parameters
array $form: The form in which to interate to hide the text_format elements.
1 call to simplify_hide_text_format_elements()
- simplify_hide_field in ./
simplify.module - Hide a given field in a form.
File
- ./
simplify.module, line 586 - Hooks implemented by the simplify module.
Code
function simplify_hide_text_format_elements(array &$form) {
foreach (Element::children($form) as $key) {
if (!isset($form[$key]['#type']) || $form[$key]['#type'] == 'container') {
simplify_hide_text_format_elements($form[$key]);
}
elseif ($form[$key]['#type'] == 'text_format') {
$form[$key]['#after_build'][] = 'simplify_hide_text_format_element';
}
}
}