diff --git a/plugins/array_filter.inc b/plugins/array_filter.inc index e69de29..3932b38 100644 --- a/plugins/array_filter.inc +++ b/plugins/array_filter.inc @@ -0,0 +1,28 @@ + 'feeds_tamper_array_filter_form', + 'callback' => 'feeds_tamper_array_filter_callback', + 'name' => 'Array filter', + 'multi' => 'direct', + 'category' => 'List', +); + +function feeds_tamper_array_filter_form($importer, $element_key, $settings) { + $form = array(); + $form['help'] = array( + '#markup' => t('Filter out empty values from an array.'), + ); + return $form; +} + +function feeds_tamper_array_filter_callback($result, $item_key, $element_key, &$field, $settings, $source) { + if(is_array($field)){ + $field = array_filter($field); + } +}