#39032 closed defect (bug) (fixed)
When saving Custom CSS, preserve the original version in the revision history.
| Reported by: | georgestephanis | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.7 |
| Component: | Customize | Version: | 4.7 |
| Severity: | major | Keywords: | has-patch has-unit-tests commit dev-reviewed |
| Cc: | Focuses: |
Description
Related: #30854
When saving CSS revisions via wp_update_custom_css_post() the initial css is lost, and only subsequent updates are versioned in revisions in the database.
To avoid data loss, @adamsilverstein demonstrated that calling wp_update_post( $post ) immediately after insertion can create the revision correctly as a stopgap measure here: https://core.trac.wordpress.org/attachment/ticket/30854/test_wp_first_revision_is_not_lost.2.diff
This is only a targeted fix, and will not preserve the first revision of posts managed via the new WP REST API endpoints.
Attachments (6)
Change History (12)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The scope of the patch makes sense for 4.7, except we should use
wp_save_post_revision().