wphooks.info - wp_save_post_revision_post_has_changed

wp_save_post_revision_post_has_changed

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/revision.php:
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
			 *
			 * By default a revision is saved only if one of the revisioned fields has changed.
			 * This filter allows for additional checks to determine if there were changes.
			 *
			 * @since 4.1.0
			 *
			 * @param bool    $post_has_changed Whether the post has changed.
			 * @param WP_Post $last_revision    The last revision post object.
			 * @param WP_Post $post             The post object.
			 */
			$post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $last_revision, $post );

			//don't save revision if post unchanged
			if ( ! $post_has_changed ) {
				return;
			}
		}
	}

	$return = _wp_put_post_revision( $post );