function _webform_update_elements_clear_properties_recursive in Webform 8.5
Same name and namespace in other branches
- 6.x includes/webform.install.inc \_webform_update_elements_clear_properties_recursive()
Recursively clear/remove selected webform element properties.
Parameters
array $element: An element.
array $properties: An associative array of webform element properties.
1 call to _webform_update_elements_clear_properties_recursive()
- _webform_update_elements_clear_properties in includes/
webform.install.inc - Clear/remove selected webform element properties.
File
- includes/
webform.install.inc, line 419 - Webform install helper functions.
Code
function _webform_update_elements_clear_properties_recursive(array &$element, array $properties) {
foreach ($properties as $property_name => $property_value) {
if (isset($element[$property_name]) && $element[$property_name] === $property_value) {
unset($element[$property_name]);
}
}
foreach (Element::children($element) as $key) {
if (is_array($element[$key])) {
_webform_update_elements_clear_properties_recursive($element[$key], $properties);
}
}
}