[wp-trac] [WordPress Trac] #39581: Unexpected Date Modified after delete and re-import

WordPress Trac noreply at wordpress.org
Tue Jan 17 03:48:23 UTC 2017


#39581: Unexpected Date Modified after delete and re-import
-------------------------------+----------------------
 Reporter:  ChiefAlchemist     |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.7.1
 Severity:  normal             |  Resolution:  invalid
 Keywords:                     |     Focuses:
-------------------------------+----------------------

Comment (by rmccue):

 It depends on how exactly you're importing here. When posts are first
 created, the modified time is
 [https://github.com/WordPress/WordPress/blob/4a1108b9f9da0a563402cf6c8a1cd103c441eeb3
 /wp-includes/post.php#L3147-L3153 set to the post date]. On subsequent
 updates, the modified time is changed to the current time.

 If you're only calling `wp_insert_post` a single time (to create the
 post), the post status is set to `publish`, and you're passing in a post
 date, then the modified time will be set to the supplied post date.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39581#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list