You are here

function _skinr_array_strip_empty in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr.module \_skinr_array_strip_empty()
  2. 6.2 skinr.module \_skinr_array_strip_empty()
  3. 6 includes/handlers.inc \_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.
skinr_ui_form_submit in ./skinr_ui.edit.inc
Form submission handler for skinr_ui_form_alter().

File

./skinr.module, line 1224
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;
}