Permalink
Browse files

Correct publish date in Webcomic Generator. Fixes #53

  • Loading branch information...
1 parent f47cb5a commit 2a7c78d50bf54f255b512baeea0ac8f1b54dd5b1 @mgsisk committed Oct 6, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 -/php/media.php
View
@@ -112,16 +112,15 @@ public function admin_init() {
);
foreach ( $attachments as $id ) {
- $date = current_time( 'mysql' );
$attachment = get_post( $id );
if ( $new_post = wp_insert_post( array(
'post_type' => $_POST[ 'webcomic_collection' ],
- 'post_date' => $date,
+ 'post_date' => date( 'Y-m-d H:i:s', $now ),
'post_title' => $attachment->post_title,
'post_status' => $draft ? 'draft' : 'publish',
'post_content' => ' ',
- 'post_date_gmt' => get_gmt_from_date( $date )
+ 'post_date_gmt' => get_gmt_from_date( date( 'Y-m-d H:i:s', $now ) )
) ) and !is_wp_error( $new_post ) ) {
if ( wp_update_post( array( 'ID' => $id, 'post_parent' => $new_post ) ) ) {
add_post_meta( $new_post, 'webcomic_prints', self::$config[ 'collections' ][ $_POST[ 'webcomic_collection' ] ][ 'commerce' ][ 'prints' ], true );

0 comments on commit 2a7c78d

Please sign in to comment.