wp_save_post_revision_check_for_changes WordPress Filter Hook

wp_save_post_revision_check_for_changes is a Wordpress hook that is called when a post is saved as a revision. This hook allows you to check for changes to the post before it is saved as a revision.

apply_filters( 'wp_save_post_revision_check_for_changes', bool $check_for_changes, WP_Post $last_revision, WP_Post $post ) #

Filters whether the post has changed since the last revision.


Description

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.


Top ↑

Parameters

$check_for_changes

(bool)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.


Top ↑

Source

File: wp-includes/revision.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.