[wp-trac] [WordPress Trac] #57320: Revisions: add filter before deleting revisions
WordPress Trac
noreply at wordpress.org
Mon Dec 12 16:37:23 UTC 2022
#57320: Revisions: add filter before deleting revisions
----------------------------+-----------------------------
Reporter: jhned | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Revisions | Version: trunk
Severity: trivial | Keywords:
Focuses: administration |
----------------------------+-----------------------------
I'm in a situation where I need to preserve the original post revision and
prevent it from being deleted once a post is past the max number of
revisions for the site. This is more difficult than it seemed, because
WordPress doesn't have many filters around the revisions delete process.
If we add a new filter to the result of `wp_get_post_revisions` in
[https://github.com/WordPress/WordPress/blob/master/wp-
includes/revision.php#L201 revision.php], then I'd be able to slice out
the revision that I don't want to get deleted and instead delete the next-
oldest one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57320>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list