Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10401 closed defect (bug) (invalid)

Importing future posts through WXR doesn't schedule posts

Reported by: joostdevalk Owned by: markjaquith
Milestone: Priority: normal
Severity: normal Version:
Component: Import Keywords: has-patch needs-testing
Focuses: Cc:


When importing a future post, the importer should immediately schedule the publish event.

Attachments (1)

import-wordpress.php.patch (605 bytes) - added by joostdevalk 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 joostdevalk5 years ago

  • Keywords has-patch needs-testing added
  • Owner set to joostdevalk
  • Status changed from new to accepted

comment:2 markjaquith5 years ago

  • Owner changed from joostdevalk to markjaquith

You have to pass a UNIX timestamp in to wp_schedule_single_event(). Wouldn't that be a MySQL DateTime in $post_date ?

comment:3 joostdevalk5 years ago

Hmm should have checked that, doesn't that mean adding a single strtotime around the date?

comment:4 markjaquith5 years ago

Check out how it's done in other places. Also, keep aware that it should be GMT, so use the GMT datetime and append ' GMT'

joostdevalk5 years ago


comment:5 joostdevalk5 years ago

Fixed, thanks for the remarks Mark!

comment:6 joostdevalk5 years ago

  • Resolution set to invalid
  • Status changed from accepted to closed

Should have checked better, while testing the import on an unpatched version, I noticed it works already, so the server I encountered the issue on had other problems. _transition_post_status actually DOES schedule the post on insertion.

comment:7 Denis-de-Bernardy4 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.