[wp-trac] [WordPress Trac] #30854: `wp_insert_post` doesn't save revision for new published post

WordPress Trac noreply at wordpress.org
Fri Dec 2 05:07:06 UTC 2016

#30854: `wp_insert_post` doesn't save revision for new published post
 Reporter:  JamesDiGioia  |       Owner:  adamsilverstein
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Revisions     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:

Comment (by adamsilverstein):

 In [attachment:30854.diff]:

 * Hook `wp_save_post_revision` on to `new_to_publish` in addition to
 `update_post` - triggering a revision save when a new post is created
 * Adjust revisions unit test to accommodate change: bump expected revision
 counts by 1, add first revision to order by comparisons

 This needs more testing, especially around creating posts in the admin
 interface and verifying that we aren't getting duplicate initial

Ticket URL: <https://core.trac.wordpress.org/ticket/30854#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list