Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Correct date format before importing with WP ALL Import
/**
* correct Date in XML from Pericles fr-> en
*/
function thfo_correct_date($biens) {
$date = explode( '/', $biens->DATE_MODIF );
$date = $date[2] . '/' . $date[1] . '/' . $date[0];
$date = date( 'Y/m/d', strtotime( $date ) );
$biens->DATE_MODIF = $date;
return $biens;
}
add_filter('wpallimport_xml_row', 'thfo_correct_date', 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment