in web/wp-content/plugins/acf-extended/includes/modules/form/module-form-action-term.php [457:529]
function prepare_save_action($action){
$save = $this->item;
// general
$save['type'] = $action['type'];
$save['name'] = $action['name'];
// save loop
foreach(array_keys($save['save']) as $k){
// taxonomy => save_taxonomy
if(acf_maybe_get($action, "save_{$k}")){
$save['save'][ $k ] = $action["save_{$k}"];
}
}
// groups
$keys = array(
'save' => array('target', 'description', 'parent'),
'load' => array('source'),
);
foreach($keys as $parent => $row){
foreach($row as $key){
$group = $action["{$parent}_{$key}_group"];
$save[ $parent ][ $key ] = $group[ $key ];
if($group[ $key ] === 'custom'){
$save[ $parent ][ $key ] = $group["{$key}_custom"];
}
}
}
// check load switch activated
if($action['load_active']){
// load loop
foreach(array_keys($save['load']) as $k){
// taxonomy => load_taxonomy
if(acf_maybe_get($action, "load_{$k}")){
$value = $action["load_{$k}"];
$save['load'][ $k ] = $value;
// assign to save array when field_key
if(isset($save['save'][ $k ]) && !empty($value) && is_string($value) && acf_is_field_key($value)){
$save['save'][ $k ] = "{field:$value}";
}
}
}
}
// default save: target
if($action['type'] === 'update_term' && empty($save['save']['target'])){
$save['save']['target'] = '{term}';
}
// default load: source
if($action['load_active'] && empty($save['load']['source'])){
$save['load']['source'] = '{term}';
}
return $save;
}