apply_filters( 'wp_revisions_to_keep', int $num , WP_Post $post )
Filters the number of revisions to save for the given post.
Contents
Description
Overrides the value of WP_POST_REVISIONS.
Parameters
-
$num
int -
Number of revisions to store.
-
$post
WP_Post -
Post object.
More Information
- By default, an infinite number of revisions are stored if a post type supports revisions.
- Note that the filter callback functions must return a value after it is finished processing or the revisions will be empty.
Source
File: wp-includes/revision.php
.
View all references
$num = apply_filters( 'wp_revisions_to_keep', $num, $post );
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example migrated from Codex:
The example below sets the number of revisions for a theoretical post type ‘my_custom_post’.