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

WordPress Trac noreply at wordpress.org
Thu May 6 10:30:19 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.8
Component:  Revisions                 |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by Clorith):

 I had a look at [attachment:"30854.3.diff"], which appears to add a post
 revision when a post gets the status  publish`.

 Cross referencing a bbPress ticket here
 (https://bbpress.trac.wordpress.org/ticket/3389), which is a big scenario
 which needs to account for existing content as well.

 The current behavior is that the first edit of an entry in a custom post
 type overwrites the initial post content entirely in the revision history,
 and then creates an autosave, completely removing any knowledge of the
 very first post made.

 By just adding a filter to when a post gets the `publish` status, would
 this not be limiting the fix to new posts, not existing published ones?

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


More information about the wp-trac mailing list