Skip to content

Commit

Permalink
Move empty check above so $args gets proper values. 🍂 #hacktoberfest
Browse files Browse the repository at this point in the history
  • Loading branch information
JayWood committed Oct 7, 2017
1 parent 052e3e6 commit 76b36ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ protected function blob_to_post( WordPress_GitHub_Sync_Blob $blob ) {
}

if ( array_key_exists( 'post_date', $meta ) ) {
$args['post_date'] = $meta['post_date'];

if ( empty( $meta['post_date'] ) ) {
$meta['post_date'] = current_time( 'mysql' );
}

$args['post_date'] = $meta['post_date'];

$args['post_date_gmt'] = get_gmt_from_date( $meta['post_date'] );
unset( $meta['post_date'] );
}
Expand Down

0 comments on commit 76b36ed

Please sign in to comment.