function _skinr_array_strip_empty in Skinr 8.2
Same name and namespace in other branches
- 6.2 skinr.module \_skinr_array_strip_empty()
- 6 includes/handlers.inc \_skinr_array_strip_empty()
- 7.2 skinr.module \_skinr_array_strip_empty()
Helper function to remove empty skins from an array.
Parameters
$array: A single or multi-dimensional array to strip of empty values.
Return value
An array stripped of empty values.
3 calls to _skinr_array_strip_empty()
- skinr_context_ui_form_submit in skinr_context/
skinr_context_ui.module - Form submission handler for skinr_context_form_alter().
- skinr_skin_validate in ./
skinr.module - Validate a skinr object.
- SkinsEditForm::submitForm in skinr_ui/
src/ Form/ SkinsEditForm.php - Form submission handler.
File
- ./
skinr.module, line 1064 - Handles core Skinr functionality.
Code
function _skinr_array_strip_empty($array) {
$new_array = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$value = _skinr_array_strip_empty($value);
}
if (!empty($value)) {
$new_array[$key] = $value;
}
}
return $new_array;
}