Make WordPress Core

Opened 8 years ago

Closed 5 years ago

#41227 closed defect (bug) (duplicate)

Ability to pass post_modified and post_modified_gmt to wp_insert_post

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

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 8 years ago.
41227.2.patch (2.2 KB) - added by JPry 7 years ago.

Download all attachments as: .zip

Change History (8)

@shamim51
8 years ago

#1 @shamim51
8 years ago

  • Keywords has-patch added

#2 @JPry
7 years ago

  • Keywords has-unit-tests added
  • Type changed from enhancement to defect (bug)
  • Version set to 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.

@JPry
7 years ago

#3 @johnbillion
7 years ago

  • Milestone changed from Awaiting Review to 5.0
  • Owner set to johnbillion
  • Status changed from new to reviewing
  • Version trunk deleted

#4 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1

#5 @pento
6 years ago

  • Keywords 2nd-opinion added
  • Milestone changed from 5.1 to 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
5 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from reviewing to 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.