WordPress at Your Fingertips
filter is not described

wp_(post_type)_revisions_to_keep filter-hook . WP 5.8.0

Filters the number of revisions to save for the given post by its post type.

Overrides both the value of WP_POST_REVISIONS and the wp_revisions_to_keep filter.

The dynamic portion of the hook name, $post->post_type, refers to the post type slug.


add_filter( 'wp_(post_type)_revisions_to_keep', 'filter_function_name_3328', 10, 2 );
function filter_function_name_3328( $num, $post ){
	// filter...

	return $num;
Number of revisions to store.
Post object.


Since 5.8.0 Introduced.

Where the hook is called

wp-includes/revision.php 582
$num = apply_filters( "wp_{$post->post_type}_revisions_to_keep", $num, $post );

Where in WP core the hook is used WordPress

Usage not found.