wp_save_post_revision_check_for_changes filter-hook . WP 3.6.0
Filters whether the post has changed since the last revision.
By default a revision is saved only if one of the revisioned fields has changed. This filter can override that so a revision is saved even if nothing has changed.
Usage
add_filter( 'wp_save_post_revision_check_for_changes', 'filter_function_name_9509', 10, 3 ); function filter_function_name_9509( $check_for_changes, $last_revision, $post ){ // filter... return $check_for_changes; }
- $check_for_changes(true/false)
- Whether to check for changes before saving a new revision.
Default: true - $last_revision(WP_Post)
- The last revision post object.
- $post(WP_Post)
- The post object.
Changelog
Since 3.6.0 | Introduced. |
Where the hook is called
wp_save_post_revision_check_for_changes
wp-includes/revision.php 159
if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) {