Make WordPress Core

Opened 16 years ago

Closed 11 years ago

#15946 closed defect (bug) (fixed)

post_date_gmt ignored in wp_insert_post()

Reported by: kawauso Owned by: wonderboymusic
Priority: normal Milestone: 4.4
Component: Posts, Post Types Version: 3.1
Severity: normal Keywords: has-patch dev-feedback
Cc: Focuses:

Description

If a post is inserted with post_date_gmt set and post_date not, post_date defaults to the current date/time, rather than being generated from post_date_gmt

Attachments (3)

15946.diff (1.2 KB ) - added by kawauso 16 years ago.
Generate post date from GMT if present and remove redundant part of if() clause
15946.2.diff (2.2 KB ) - added by oso96_2000 12 years ago.
Refreshed patch with unit test
15946.3.diff (2.2 KB ) - added by oso96_2000 11 years ago.
Refreshed patch

Download all attachments as: .zip

Change History (9)

@kawauso
16 years ago

Generate post date from GMT if present and remove redundant part of if() clause

#1 @nacin
16 years ago

  • Milestone Awaiting ReviewFuture Release

#2 @nacin
13 years ago

  • Component GeneralPost Types

@oso96_2000
12 years ago

Refreshed patch with unit test

#3 @oso96_2000
12 years ago

  • Keywords dev-feedback added

Hello @kawauso! Thanks for the patch, sorry fort aking too long to respond. I refreshed it and added a unit test.

#4 @wonderboymusic
11 years ago

  • Keywords needs-refresh added
  • Milestone Future Release4.4

@oso96_2000
11 years ago

Refreshed patch

#5 @oso96_2000
11 years ago

  • Keywords needs-refresh removed

I removed the $updated part from old patches in the new one. Tests for post group seems to run fine.

#6 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 34762:

Posts: In wp_insert_post(), don't set post_date to current time if it can be derived from a passed value for post_date_gmt.

Adds unit tests.

Props oso96_2000, kawauso.
Fixes #15946.

Note: See TracTickets for help on using tickets.