Make WordPress Core

Ticket #7392: 7392-3.diff

File 7392-3.diff, 2.5 KB (added by adamsilverstein, 12 years ago)

removed error_log

  • wp-includes/default-filters.php

     
    249249add_action( 'plugins_loaded',             'wp_maybe_load_widgets',                    0    );
    250250add_action( 'plugins_loaded',             'wp_maybe_load_embeds',                     0    );
    251251add_action( 'shutdown',                   'wp_ob_end_flush_all',                      1    );
    252 add_action( 'pre_post_update',            'wp_save_post_revision'                          );
     252add_action( 'pre_post_update',            'wp_save_post_revision',                   10, 2 );
    253253add_action( 'publish_post',               '_publish_post_hook',                       5, 1 );
    254254add_action( 'transition_post_status',     '_transition_post_status',                  5, 3 );
    255255add_action( 'transition_post_status',     '_update_term_count_on_transition_post_status', 10, 3 );
  • wp-includes/post.php

     
    28662866        $where = array( 'ID' => $post_ID );
    28672867
    28682868        if ( $update ) {
    2869                 do_action( 'pre_post_update', $post_ID );
     2869                do_action( 'pre_post_update', $post_ID, $data );
    28702870                if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
    28712871                        if ( $wp_error )
    28722872                                return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error);
     
    49374937 * @param int $post_id The ID of the post to save as a revision.
    49384938 * @return mixed Null or 0 if error, new revision ID, if success.
    49394939 */
    4940 function wp_save_post_revision( $post_id ) {
     4940function wp_save_post_revision( $post_id, $new_data = null ) {
    49414941        // We do autosaves manually with wp_create_post_autosave()
    49424942        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
    49434943                return;
     
    49554955        if ( !post_type_supports($post['post_type'], 'revisions') )
    49564956                return;
    49574957
     4958        // if new data is supplied, check that it is different from last saved revision
     4959        if( is_array( $new_data ) ) {
     4960                $post_has_changed = false;
     4961                foreach( array_keys( _wp_post_revision_fields() ) as $field ) {
     4962                        if( normalize_whitespace( $new_data[ $field ] ) != normalize_whitespace( $post[ $field ] ) ) {
     4963                                $post_has_changed = true;
     4964                                break;
     4965                        }
     4966                }
     4967                //don't save revision if post unchanged
     4968                if( ! $post_has_changed )
     4969                        return;
     4970        }
     4971
    49584972        $return = _wp_put_post_revision( $post );
    49594973
    49604974        // WP_POST_REVISIONS = true (default), -1