[wp-trac] [WordPress Trac] #35880: Refactor date handling in wp_insert_post()

WordPress Trac noreply at wordpress.org
Fri Feb 19 20:36:10 UTC 2016

#35880: Refactor date handling in wp_insert_post()
 Reporter:  redsweater   |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
 I started refactoring this code while researching #35874, because I
 thought the unpredictable logic in this function might have contributed to
 the problems described there. Although that turned out not to be the case,
 I think the refactoring I've done is still valuable. Effectively I've
 aimed to clarify the code by leaning heavily on standardizing the
 validation of submitted dates into the $post_date variable, and then
 converting that back to a GMT based $post_date_gmt only when all other
 shared validation is completed.

 In my opinion this makes the code easier to read and maintain, but as this
 doesn't specifically address any known bug, I will appreciate it if it
 doesn't seem worth integrating.

Ticket URL: <https://core.trac.wordpress.org/ticket/35880>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list