[wp-trac] [WordPress Trac] #51550: Revisions: Add a post type-specific filter to `wp_revisions_to_keep()`

WordPress Trac noreply at wordpress.org
Fri Oct 16 06:22:39 UTC 2020


#51550: Revisions: Add a post type-specific filter to `wp_revisions_to_keep()`
-------------------------+-----------------------------
 Reporter:  dlh          |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Revisions    |    Version:
 Severity:  normal       |   Keywords:  has-patch
  Focuses:               |
-------------------------+-----------------------------
 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' );`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51550>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list