Hi Daniel,
An example of how to use the built in filters to update a importer templates field value, please make sure to change the importer id, or commend out that if statement if you do not want to restrict it to a specific importer:
<?php
/**
* Example code to alter the value of an Importer Templates field
*
* @param string $value Field value to insert
* @param stirng $key Field name
* @param ImportWP\Common\Model\ImporterModel $importer
* @return string
*/
function iwpe_alter_field_value_example($value, $key, $importer)
{
// restrict filter to specific importer (in this case id 47, change to what you need), comment out if not needed
if ($importer->getId() !== 47) {
return $value;
}
switch ($key) {
case 'post_date':
$value = date('Y-m-d H:i:s', strtotime($value));
break;
}
return $value;
}
add_filter('iwp/template/process_field', 'iwpe_alter_field_value_example', 10, 3);
If you need anymore help let me know and i will do my best to help out.
James
Hi Daniel,
An example of how to use the built in filters to update a importer templates field value, please make sure to change the importer id, or commend out that if statement if you do not want to restrict it to a specific importer:
If you need anymore help let me know and i will do my best to help out.
James