[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 04:14:21 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):
Still digging into this issue, however I posted
[attachment:test_wp_first_revision_is_not_lost.2.diff] to demonstrate
[https://core.trac.wordpress.org/ticket/30854#comment:2 this workaround]
by calling `wp_update_post` immediately after creating the post, passing
the returned post object, the issue is resolved. I think this actually
mirrors what happens when you create a post in the admin.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30854#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list