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

WordPress Trac noreply at wordpress.org
Fri Feb 5 15:59:01 UTC 2021


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

Comment (by adamsilverstein):

 Excellent, thank you @Mista-Flo!

 @hellofromTonya testing by hand is tricky from the UI because this ticket
 deals with a programmatic insertion of a post rather than one created in
 the UI.

 One possible test would to try importing some posts using the WordPress
 importer. After this patch, imported posts should get an initial revision,
 better matching posts created in the UI (and something we worked around
 recently in the revision screen). You will have to look in the DB to see
 the difference though because we "fake" the initial revision on the
 revisions screen when it is missing.

 A second test would be to review the bug fixed in
 https://core.trac.wordpress.org/ticket/39032. The fix for that is now
 reverted in the latest patch, because the new fix here corrects the issue.

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


More information about the wp-trac mailing list