Make WordPress Core

Opened 9 years ago

Closed 7 years ago

#41227 closed defect (bug) (duplicate)

Ability to pass post_modified and post_modified_gmt to wp_insert_post

Reported by: shamim51 Owned by: johnbillion
Priority: normal Milestone:
Component: Posts, Post Types Version:
Severity: normal Keywords: has-patch has-unit-tests 2nd-opinion
Cc: Focuses:

Description

It is hard-coded that post_modified and post_modified_gmt will be current time or post_date. But sometimes it can be needed to have custom date passed to wp_insert_post/wp_update_post.

Attachments (2)

41227.patch​ (1.3 KB ) - added by shamim51 9 years ago.
41227.2.patch​ (2.2 KB ) - added by JPry 9 years ago.

Download all attachments as: .zip

Change History (8)

#1 @shamim51
9 years ago

  • Keywords has-patch added

#2 @JPry
9 years ago

  • Keywords has-unit-tests added
  • Type enhancement → defect (bug)
  • Version → trunk

I believe this issue should actually be classified as a bug. According to the docblock for wp_insert_post(), the values for post_modified and post_modified_gmt should already be accepted.

I'm uploading a refreshed patch that includes unit tests.

#3 @johnbillion
9 years ago

  • Milestone Awaiting Review → 5.0
  • Owner set to johnbillion
  • Status new → reviewing
  • Version trunk

#4 @johnbillion
8 years ago

  • Milestone 5.0 → 5.1

#5 @pento
8 years ago

  • Keywords 2nd-opinion added
  • Milestone 5.1 → Future Release

I suspect there will be all sorts of weird side effects to this. This change needs very careful consideration before merging.

#6 @SergeyBiryukov
7 years ago

  • Milestone Future Release
  • Resolution → duplicate
  • Status reviewing → closed

Hi there, welcome back to WordPress Trac!

Thanks for the report, we're already tracking this issue in #36595.

Note: See TracTickets for help on using tickets.