Make WordPress Core

Opened 6 weeks 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 6 weeks ago.

Download all attachments as: .zip

Change History (1)

6 weeks ago

Note: See TracTickets for help on using tickets.