You are here

function feeds_tamper_default_value_callback in Feeds Tamper 7

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

File

plugins/default_value.inc, line 36

Code

function feeds_tamper_default_value_callback($result, $item_key, $element_key, &$field, $settings, $source) {

  // Setting a default value.
  if (!empty($settings['only_if_empty']) && !$field) {
    $field = $settings['default_value'];
  }
  elseif (empty($settings['only_if_empty'])) {
    $field = $settings['default_value'];
  }
}