Make WordPress Core

Opened 4 months ago

#51550 new enhancement

Revisions: Add a post type-specific filter to `wp_revisions_to_keep()`

Reported by: dlh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Revisions Keywords: has-patch
Focuses: Cc:


The attached patch proposes a post type-specific filter for wp_revisions_to_keep() to complement the wp_revisions_to_keep filter.

wp_revisions_to_keep is a perfectly capable filter; the one proposed here offers just some added developer convenience for simpler cases. For example:

add_filter( 'wp_post_revisions_to_keep', fn () => 500 );
add_filter( 'wp_page_revisions_to_keep', '__return_zero' );

Attachments (1)

51550.diff (955 bytes) - added by dlh 4 months ago.

Download all attachments as: .zip

Change History (1)

4 months ago

Note: See TracTickets for help on using tickets.