[wp-trac] [WordPress Trac] #36595: can't set post_modified in wp_insert_post, becomes post_date

WordPress Trac noreply at wordpress.org
Tue Apr 19 17:22:32 UTC 2016


#36595: can't set post_modified in wp_insert_post, becomes post_date
-------------------------------+------------------------------
 Reporter:  gijsgg             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  1.0
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------
Changes (by Latz):

 * version:  4.2 => 1.0


Comment:

 @swisspidy

 That brings up the question if the parameter is used **anywhere** in core
 and if it isn't, if it wouldn't be a good idea to remove it from the code.

 I have used `wp_insert_post` myself in a plugin and had expected that it
 would be set to the parameters date, so I didn't even checked it. Now I
 need to change the code and hack it into the database directly which isn't
 best practice at all.

 Real world case: Import posts from another CMS.

 tldr: Remove the parameter or fix the code.

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


More information about the wp-trac mailing list