You are here

function feeds_tamper_explode_callback in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 plugins/explode.inc \feeds_tamper_explode_callback()
1 string reference to 'feeds_tamper_explode_callback'
explode.inc in plugins/explode.inc

File

plugins/explode.inc, line 48

Code

function feeds_tamper_explode_callback($result, $item_key, $element_key, &$field, $settings, $source) {
  if (!is_array($field)) {
    $field = array(
      $field,
    );
  }
  $out = array();
  foreach ($field as $f) {
    if ($settings['limit'] === '') {
      $out = array_merge($out, explode($settings['real_separator'], $f));
    }
    else {
      $out = array_merge($out, explode($settings['real_separator'], $f, $settings['limit']));
    }
  }
  $field = $out;
}