@@ -1513,17 +1513,17 @@ protected function _insert_post( $user, $content_struct ) {
15131513 // Do some timestamp voodoo.
15141514 if ( ! empty ( $ post_data ['post_date_gmt ' ] ) ) {
15151515 // We know this is supposed to be GMT, so we're going to slap that Z on there by force.
1516- $ dateCreated = rtrim ( $ post_data ['post_date_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
1516+ $ date_created = rtrim ( $ post_data ['post_date_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
15171517 } elseif ( ! empty ( $ post_data ['post_date ' ] ) ) {
1518- $ dateCreated = $ post_data ['post_date ' ]->getIso ();
1518+ $ date_created = $ post_data ['post_date ' ]->getIso ();
15191519 }
15201520
15211521 // Default to not flagging the post date to be edited unless it's intentional.
15221522 $ post_data ['edit_date ' ] = false ;
15231523
1524- if ( ! empty ( $ dateCreated ) ) {
1525- $ post_data ['post_date ' ] = iso8601_to_datetime ( $ dateCreated );
1526- $ post_data ['post_date_gmt ' ] = iso8601_to_datetime ( $ dateCreated , 'gmt ' );
1524+ if ( ! empty ( $ date_created ) ) {
1525+ $ post_data ['post_date ' ] = iso8601_to_datetime ( $ date_created );
1526+ $ post_data ['post_date_gmt ' ] = iso8601_to_datetime ( $ date_created , 'gmt ' );
15271527
15281528 // Flag the post date to be edited.
15291529 $ post_data ['edit_date ' ] = true ;
@@ -3837,9 +3837,10 @@ public function wp_editComment( $args ) {
38373837 // Do some timestamp voodoo.
38383838 if ( ! empty ( $ content_struct ['date_created_gmt ' ] ) ) {
38393839 // We know this is supposed to be GMT, so we're going to slap that Z on there by force.
3840- $ dateCreated = rtrim ( $ content_struct ['date_created_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
3841- $ comment ['comment_date ' ] = get_date_from_gmt ( $ dateCreated );
3842- $ comment ['comment_date_gmt ' ] = iso8601_to_datetime ( $ dateCreated , 'gmt ' );
3840+ $ date_created = rtrim ( $ content_struct ['date_created_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
3841+
3842+ $ comment ['comment_date ' ] = get_date_from_gmt ( $ date_created );
3843+ $ comment ['comment_date_gmt ' ] = iso8601_to_datetime ( $ date_created , 'gmt ' );
38433844 }
38443845
38453846 if ( isset ( $ content_struct ['content ' ] ) ) {
@@ -5571,16 +5572,16 @@ public function mw_newPost( $args ) {
55715572 // Do some timestamp voodoo.
55725573 if ( ! empty ( $ content_struct ['date_created_gmt ' ] ) ) {
55735574 // We know this is supposed to be GMT, so we're going to slap that Z on there by force.
5574- $ dateCreated = rtrim ( $ content_struct ['date_created_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
5575+ $ date_created = rtrim ( $ content_struct ['date_created_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
55755576 } elseif ( ! empty ( $ content_struct ['dateCreated ' ] ) ) {
5576- $ dateCreated = $ content_struct ['dateCreated ' ]->getIso ();
5577+ $ date_created = $ content_struct ['dateCreated ' ]->getIso ();
55775578 }
55785579
55795580 $ post_date = '' ;
55805581 $ post_date_gmt = '' ;
5581- if ( ! empty ( $ dateCreated ) ) {
5582- $ post_date = iso8601_to_datetime ( $ dateCreated );
5583- $ post_date_gmt = iso8601_to_datetime ( $ dateCreated , 'gmt ' );
5582+ if ( ! empty ( $ date_created ) ) {
5583+ $ post_date = iso8601_to_datetime ( $ date_created );
5584+ $ post_date_gmt = iso8601_to_datetime ( $ date_created , 'gmt ' );
55845585 }
55855586
55865587 $ post_category = array ();
@@ -5958,17 +5959,17 @@ public function mw_editPost( $args ) {
59585959 // Do some timestamp voodoo.
59595960 if ( ! empty ( $ content_struct ['date_created_gmt ' ] ) ) {
59605961 // We know this is supposed to be GMT, so we're going to slap that Z on there by force.
5961- $ dateCreated = rtrim ( $ content_struct ['date_created_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
5962+ $ date_created = rtrim ( $ content_struct ['date_created_gmt ' ]->getIso (), 'Z ' ) . 'Z ' ;
59625963 } elseif ( ! empty ( $ content_struct ['dateCreated ' ] ) ) {
5963- $ dateCreated = $ content_struct ['dateCreated ' ]->getIso ();
5964+ $ date_created = $ content_struct ['dateCreated ' ]->getIso ();
59645965 }
59655966
59665967 // Default to not flagging the post date to be edited unless it's intentional.
59675968 $ edit_date = false ;
59685969
5969- if ( ! empty ( $ dateCreated ) ) {
5970- $ post_date = iso8601_to_datetime ( $ dateCreated );
5971- $ post_date_gmt = iso8601_to_datetime ( $ dateCreated , 'gmt ' );
5970+ if ( ! empty ( $ date_created ) ) {
5971+ $ post_date = iso8601_to_datetime ( $ date_created );
5972+ $ post_date_gmt = iso8601_to_datetime ( $ date_created , 'gmt ' );
59725973
59735974 // Flag the post date to be edited.
59745975 $ edit_date = true ;
0 commit comments