Make WordPress Core

Changeset 23415


Ignore:
Timestamp:
02/14/2013 04:45:43 PM (12 years ago)
Author:
westi
Message:

Revisions: Allow a plugin to force us to skip the don't save this revision because it hasn't changed code if it knows better.

See #7392 and #9843. Also cleans up the whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r23414 r23415  
    49484948        return;
    49494949
    4950     // if new data is supplied, check that it is different from last saved revision
    4951     if( is_array( $new_data ) ) {
     4950    // if new data is supplied, check that it is different from last saved revision, unless a plugin tells us to always save regardless
     4951    if ( apply_filters( 'wp_save_post_revision_check_for_changes', true, $post, $new_data ) && is_array( $new_data ) ) {
    49524952        $post_has_changed = false;
    4953         foreach( array_keys( _wp_post_revision_fields() ) as $field ) {
    4954             if( normalize_whitespace( $new_data[ $field ] ) != normalize_whitespace( $post[ $field ] ) ) {
     4953        foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
     4954            if ( normalize_whitespace( $new_data[ $field ] ) != normalize_whitespace( $post[ $field ] ) ) {
    49554955                $post_has_changed = true;
    49564956                break;
Note: See TracChangeset for help on using the changeset viewer.