Last active
March 22, 2018 07:16
-
-
Save sebastienserre/f9f42b947cb05391bf08ae20a64b8f51 to your computer and use it in GitHub Desktop.
Correct date format before importing with WP ALL Import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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