Skip to content

Instantly share code, notes, and snippets.

@sebastienserre
Last active March 22, 2018 07:16
Show Gist options
  • Save sebastienserre/f9f42b947cb05391bf08ae20a64b8f51 to your computer and use it in GitHub Desktop.
Save sebastienserre/f9f42b947cb05391bf08ae20a64b8f51 to your computer and use it in GitHub Desktop.
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